profiling-statement-fingerprints

Analyze historical SQL statement fingerprints from crdb_internal.statement_statistics for slow or resource-intensive patterns.

18|8|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill profiling-statement-fingerprints
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: profiling-statement-fingerprints
Source: https://github.com/cockroachlabs/cockroachdb-skills/tree/main/skills/observability-and-diagnostics/profiling-statement-fingerprints
Command: npx skills add https://github.com/cockroachlabs/cockroachdb-skills --skill profiling-statement-fingerprints

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The skill ranks and analyzes historical SQL fingerprints using crdb_internal.statement_statistics to identify slow, resource-intensive, or error-prone queries when DB Console access is not available.

Core Features & Use Cases

  • Analyze latency, CPU, contention, and admission waits across time buckets to surface slow fingerprints.
  • Detect plan instability by identifying multiple plan_hash values for the same fingerprint over time.
  • Provides workflows for slowness triage, contention analysis, admission control debugging, and memory/disk spill investigations.

Quick Start

Run profiling-statement-fingerprints for a 24-hour window to surface slow fingerprints and optimization opportunities.

Frequently Asked Questions about profiling-statement-fingerprints

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify slow SQL statements from historical statistics when DB Console is unavailable?▼

To identify slow SQL statements without DB Console, analyze historical statement fingerprints from crdb_internal.statement_statistics. This approach surfaces slow, resource-intensive, or error-prone queries by evaluating latency, CPU, contention, and admission waits across time buckets.

What is the best way to detect plan instability for SQL queries in CockroachDB?▼

Detecting plan instability involves analyzing historical statement fingerprints to identify multiple plan_hash values for the same query over time. By examining crdb_internal.statement_statistics, you can pinpoint when a single SQL fingerprint generates varying execution plans across different time buckets.

How do I troubleshoot admission control waits and memory spills using historical query data?▼

Troubleshoot admission control waits and memory spills by analyzing historical statement fingerprints for admission_wait metrics and resource contention. The data from crdb_internal.statement_statistics provides specific workflows to debug memory or disk spill investigations and admission control bottlenecks.

Can I analyze contention and CPU usage metrics per database or application context?▼

You can analyze contention and CPU usage metrics with per-database and per-application context support. The analysis of historical statement fingerprints handles mixed-collection metrics, including aggregated and sampled data, while satisfying JSON field handling and access permissions.

How do I find optimization opportunities for resource-intensive SQL patterns?▼

Find optimization opportunities by ranking historical SQL fingerprints to isolate resource-intensive patterns. The analysis references index recommendations when present within the historical statement statistics, helping you target queries with high latency, CPU usage, or contention for optimization.