[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-cockroachdb-profiling-transaction-fingerprints":3,"mdc--d9z159-key":36,"related-repo-cockroachdb-profiling-transaction-fingerprints":2961,"related-org-cockroachdb-profiling-transaction-fingerprints":3056},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":31,"sourceUrl":34,"mdContent":35},"profiling-transaction-fingerprints","profile CockroachDB transaction fingerprints","Analyzes transaction fingerprints using aggregated statistics from crdb_internal.transaction_statistics to identify high-retry transactions, contention patterns, and commit latency issues. Provides historical transaction-level analysis to understand which statement combinations are causing retries, contention, or performance degradation. Use when investigating transaction retry storms, analyzing commit latency trends, or understanding statement composition of problematic transactions without DB Console access.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"cockroachdb","CockroachDB","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcockroachdb.png",[12,16,19],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":20,"slug":21,"type":15},"Debugging","debugging",3,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin","2026-07-12T07:57:21.482557",null,2,[28,29,8,30],"claude","cockroach-cloud","developer-tools",{"repoUrl":23,"stars":22,"forks":26,"topics":32,"description":33},[28,29,8,30],"CockroachDB development plugin for Claude","https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin\u002Ftree\u002FHEAD\u002Fskills\u002Fcockroachdb-observability-and-diagnostics\u002Fprofiling-transaction-fingerprints","---\nname: profiling-transaction-fingerprints\ndescription: Analyzes transaction fingerprints using aggregated statistics from crdb_internal.transaction_statistics to identify high-retry transactions, contention patterns, and commit latency issues. Provides historical transaction-level analysis to understand which statement combinations are causing retries, contention, or performance degradation. Use when investigating transaction retry storms, analyzing commit latency trends, or understanding statement composition of problematic transactions without DB Console access.\ncompatibility: Requires SQL access with VIEWACTIVITY or VIEWACTIVITYREDACTED cluster privilege. Uses crdb_internal.transaction_statistics (production-safe). Execution statistics fields are sampled and may be sparse.\nmetadata:\n  author: cockroachdb\n  version: \"1.0\"\n---\n\n# Profiling Transaction Fingerprints\n\nAnalyzes historical transaction performance patterns using aggregated SQL statistics to identify high-retry transactions, contention patterns, and commit latency issues. Uses `crdb_internal.transaction_statistics` for time-windowed analysis of retry behavior, commit latency, and statement composition - entirely via SQL without requiring DB Console access.\n\n**Complement to profiling-statement-fingerprints:** This skill analyzes transaction-level patterns (groups of statements with retry behavior); for statement-level optimization, see [profiling-statement-fingerprints](..\u002Fprofiling-statement-fingerprints\u002FSKILL.md).\n\n**Complement to triaging-live-sql-activity:** This skill analyzes historical transaction patterns; for immediate triage of currently active transactions, see [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md).\n\n## When to Use This Skill\n\n- Identify transactions with high retry counts\n- Analyze commit latency trends for transaction fingerprints\n- Find transactions with high contention at transaction boundary\n- Understand statement composition of problematic transactions\n- Investigate transaction retry storms or abort patterns\n- SQL-only historical transaction analysis without DB Console access\n\n**For immediate incident response:** Use [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md) to triage currently active transactions and cancel runaway work.\n**For statement-level optimization:** Use [profiling-statement-fingerprints](..\u002Fprofiling-statement-fingerprints\u002FSKILL.md) to analyze individual query patterns.\n\n## Prerequisites\n\n- SQL connection to CockroachDB cluster\n- `VIEWACTIVITY` or `VIEWACTIVITYREDACTED` cluster privilege for cluster-wide visibility\n  - Same privilege requirements as profiling-statement-fingerprints\n- Understanding of transaction performance concepts\n- Transaction statistics collection enabled (default): `sql.stats.automatic_collection.enabled = true`\n\n**Check transaction stats collection:**\n```sql\nSHOW CLUSTER SETTING sql.stats.automatic_collection.enabled;\n-- Should return: true\n```\n\nSee [triaging-live-sql-activity permissions reference](..\u002Ftriaging-live-sql-activity\u002Freferences\u002Fpermissions.md) for RBAC setup (same privileges).\n\n## Core Concepts\n\n### Transaction Fingerprints vs Live Transactions\n\n**Transaction fingerprint:** Normalized transaction pattern grouping statements with parameterized constants.\n\n**Key differences:**\n- **Time scope:** Historical hourly buckets vs real-time current state\n- **Granularity:** Aggregated retry\u002Fcommit stats vs individual transaction instances\n- **Relationship:** Transaction = collection of statement fingerprints\n\n### Time-Series Bucketing\n\n**aggregated_ts:** Hourly UTC buckets (e.g., `2026-02-21 14:00:00` = 14:00-14:59 executions)\n**Data retention:** Capped by row count, not time. `sql.stats.persisted_rows.max` (default 1,000,000) bounds the persisted statement+transaction rows; older buckets are compacted once the cap is reached. Effective wall-clock window depends on workload diversity.\n**Best practice:** Always filter by time window: `WHERE aggregated_ts > now() - INTERVAL '24 hours'`\n\n### Aggregated vs Sampled Metrics\n\n| Metric Category | JSON Path | Scope | Use Case |\n|-----------------|-----------|-------|----------|\n| **Aggregated** | `statistics.statistics.*` | All executions | Retries, commit latency, execution counts |\n| **Sampled** | `statistics.execution_statistics.*` | Probabilistic sample governed by `sql.txn_stats.sample_rate` (default 0.01) | Contention, network, memory\u002Fdisk |\n\n**Critical:** Sampled metrics have `cnt` field showing sample size. Always check:\n```sql\nWHERE (statistics->'execution_statistics'->>'cnt') IS NOT NULL\n```\n\n### JSON Field Extraction\n\nCockroachDB stores transaction metadata and statistics as JSONB. Use these operators:\n\n**Operators:**\n- `->`: Extract JSON object\u002Fvalue (returns JSON)\n- `->>`: Extract as text (returns text)\n- `::TYPE`: Cast to specific type\n- `encode(fingerprint_id, 'hex')`: Convert binary fingerprint to hex string\n\n**Transaction-specific examples:**\n```sql\nencode(fingerprint_id, 'hex') AS txn_fingerprint_id                     -- Hex encoding\n(statistics->'statistics'->>'maxRetries')::INT                           -- Max retry count\n(statistics->'statistics'->'retryLat'->>'mean')::FLOAT8                  -- Retry latency (seconds)\n(statistics->'statistics'->'commitLat'->>'mean')::FLOAT8                 -- Commit latency (seconds)\n(statistics->'statistics'->'svcLat'->>'mean')::FLOAT8                    -- Service latency (seconds)\nmetadata->'stmtFingerprintIDs' AS stmt_fingerprint_ids_json             -- Statement composition\n```\n\n**Units:**\n- Latency fields: **seconds** (FLOAT8)\n- CPU\u002Fcontention: **nanoseconds** (divide by 1e9 for seconds)\n- Memory\u002Fdisk: **bytes** (consider \u002F 1048576 for MB)\n\nSee [JSON field reference](references\u002Fjson-field-reference.md) for complete schema.\n\n### Statement Composition\n\n**metadata.stmtFingerprintIDs:** JSONB array mapping transaction to constituent statements\n\n**Use case:** Understand which statements compose high-retry transactions\n\n**Cross-reference workflow:** Join transaction_statistics with statement_statistics on fingerprint IDs\n\n**Example pattern:**\n```sql\n-- Extract statement fingerprint IDs from transaction\nmetadata -> 'stmtFingerprintIDs' AS stmt_ids\n\n-- Use with jsonb_array_elements_text to expand and join\njsonb_array_elements_text(metadata->'stmtFingerprintIDs') AS stmt_fingerprint_id\n```\n\n## Core Diagnostic Queries\n\n### Query 1: Top Transactions by Retries and Contention\n\n```sql\n-- Identify transactions with high retry counts and contention\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'db' AS database,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n  (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 AS mean_retry_lat_seconds,\n  (statistics->'execution_statistics'->'contentionTime'->>'mean')::FLOAT8 \u002F 1e9 AS mean_contention_seconds,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->>'maxRetries')::INT > 0\nORDER BY (statistics->'statistics'->>'maxRetries')::INT DESC\nLIMIT 20;\n```\n\n**Key columns:** `max_retries` shows maximum retry count; `mean_retry_lat_seconds` shows time spent in retries; `mean_contention_seconds` shows lock wait time.\n\n**Interpretation:** High max_retries (>10) indicates transaction conflicts; correlate with contention to identify lock hotspots.\n\n### Query 2: Statement Composition Analysis\n\n```sql\n-- Extract statement fingerprints for high-retry transactions\nSELECT\n  encode(t.fingerprint_id, 'hex') AS txn_fingerprint_id,\n  t.metadata->>'app' AS application,\n  (t.statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n  jsonb_array_length(t.metadata->'stmtFingerprintIDs') AS num_statements,\n  t.metadata->'stmtFingerprintIDs' AS stmt_fingerprint_ids,\n  t.aggregated_ts\nFROM crdb_internal.transaction_statistics t\nWHERE t.aggregated_ts > now() - INTERVAL '24 hours'\n  AND (t.statistics->'statistics'->>'maxRetries')::INT > 10\n  AND t.metadata->'stmtFingerprintIDs' IS NOT NULL\nORDER BY max_retries DESC\nLIMIT 20;\n```\n\n**Key columns:** `num_statements` shows transaction complexity; `stmt_fingerprint_ids` contains statement IDs for cross-reference with statement_statistics.\n\n**Use case:** Understand which statement combinations cause retries; use Query 7 to drill down to specific statements.\n\n### Query 3: High Commit Latency Transactions\n\n```sql\n-- Find transactions with slow commit latency\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'db' AS database,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 AS mean_commit_lat_seconds,\n  (statistics->'statistics'->'svcLat'->>'mean')::FLOAT8 AS mean_service_lat_seconds,\n  ROUND(\n    ((statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 \u002F\n    NULLIF((statistics->'statistics'->'svcLat'->>'mean')::FLOAT8, 0)) * 100, 2\n  ) AS commit_pct_of_service_lat,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 > 0.1  -- > 100ms commit latency\nORDER BY (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 DESC\nLIMIT 20;\n```\n\n**Key columns:** `mean_commit_lat_seconds` shows 2PC commit time; `commit_pct_of_service_lat` shows what percentage of total latency is commit overhead.\n\n**Interpretation:** High commit percentage (>20%) suggests distributed transaction overhead, replication delays, or cross-region writes.\n\n### Query 4: Retry Rate by Application\n\n```sql\n-- Analyze retry patterns by application\nSELECT\n  metadata->>'app' AS application,\n  metadata->>'db' AS database,\n  COUNT(*) AS transaction_fingerprint_count,\n  SUM((statistics->'statistics'->>'cnt')::INT) AS total_executions,\n  AVG((statistics->'statistics'->>'maxRetries')::INT) AS avg_max_retries,\n  MAX((statistics->'statistics'->>'maxRetries')::INT) AS overall_max_retries,\n  AVG((statistics->'statistics'->'retryLat'->>'mean')::FLOAT8) AS avg_retry_lat_seconds\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->>'maxRetries')::INT > 0\nGROUP BY metadata->>'app', metadata->>'db'\nORDER BY avg_max_retries DESC\nLIMIT 20;\n```\n\n**Use case:** Application-level health scorecard; identify which applications have the most problematic transaction patterns.\n\n**Customization:** Adjust time window to 7 days for trends; filter by specific database.\n\n### Query 5: Transaction Resource Consumption\n\n```sql\n-- Find transactions with high resource usage\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 \u002F 1048576 AS mean_network_mb,\n  (statistics->'execution_statistics'->'maxMemUsage'->>'mean')::FLOAT8 \u002F 1048576 AS mean_mem_mb,\n  (statistics->'execution_statistics'->'maxDiskUsage'->>'mean')::FLOAT8 \u002F 1048576 AS mean_disk_mb,\n  ROUND(\n    ((statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 \u002F 1048576) *\n    (statistics->'statistics'->>'cnt')::INT, 2\n  ) AS estimated_total_network_mb,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'execution_statistics'->>'cnt') IS NOT NULL\n  AND (statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 > 0\nORDER BY estimated_total_network_mb DESC\nLIMIT 20;\n```\n\n**Key columns:** `mean_network_mb` shows distributed transaction overhead; `mean_disk_mb` > 0 indicates memory spill.\n\n**Interpretation:** High network bytes suggest cross-region transactions or inefficient distribution; disk usage indicates memory pressure.\n\n### Query 6: Retry Latency Decomposition\n\n```sql\n-- Understand retry latency as percentage of service latency\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n  (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 AS mean_retry_lat_seconds,\n  (statistics->'statistics'->'svcLat'->>'mean')::FLOAT8 AS mean_service_lat_seconds,\n  ROUND(\n    ((statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 \u002F\n    NULLIF((statistics->'statistics'->'svcLat'->>'mean')::FLOAT8, 0)) * 100, 2\n  ) AS retry_pct_of_service_lat,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->>'maxRetries')::INT > 0\n  AND (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 > 0\nORDER BY retry_pct_of_service_lat DESC\nLIMIT 20;\n```\n\n**Interpretation:** High retry percentage (>30%) means most latency is spent retrying due to contention; optimize transaction boundaries or schema.\n\n### Query 7: Cross-Reference Transaction to Statements\n\n```sql\n-- Join transaction statistics with statement statistics to see constituent statements\nSELECT\n  encode(t.fingerprint_id, 'hex') AS txn_fingerprint_id,\n  t.metadata->>'app' AS txn_application,\n  (t.statistics->'statistics'->>'maxRetries')::INT AS txn_max_retries,\n  stmt_fp_id AS stmt_fingerprint_id,\n  s.metadata->>'query' AS statement_query,\n  (s.statistics->'statistics'->'runLat'->>'mean')::FLOAT8 AS stmt_mean_run_lat_seconds,\n  t.aggregated_ts\nFROM crdb_internal.transaction_statistics t\nCROSS JOIN LATERAL jsonb_array_elements_text(t.metadata->'stmtFingerprintIDs') AS stmt_fp_id\nLEFT JOIN crdb_internal.statement_statistics s\n  ON s.fingerprint_id = decode(stmt_fp_id, 'hex')\n  AND s.aggregated_ts = t.aggregated_ts\nWHERE t.aggregated_ts > now() - INTERVAL '24 hours'\n  AND (t.statistics->'statistics'->>'maxRetries')::INT > 10\n  AND t.metadata->'stmtFingerprintIDs' IS NOT NULL\nORDER BY txn_max_retries DESC, stmt_mean_run_lat_seconds DESC\nLIMIT 50;\n```\n\n**Use case:** Drill down from high-retry transactions to specific problematic statements; identify which statement in a transaction is causing retries.\n\n**Note:** Uses `decode(stmt_fp_id, 'hex')` to convert hex string back to binary for join with statement_statistics.\n\n## Common Workflows\n\n### Workflow 1: Retry Storm Investigation\n\n1. **Identify high-retry transactions:** Run Query 1, focus on `max_retries > 20`\n2. **Analyze retry patterns by application:** Run Query 4 to identify problematic apps\n3. **Examine statement composition:** Run Query 7 to see which statements are in high-retry transactions\n4. **Cross-reference live activity:** If ongoing, use triaging-live-sql-activity to check current transaction state\n5. **Remediate:** Adjust transaction boundaries, batch operations, optimize statements identified in step 3\n\n### Workflow 2: Commit Latency Analysis\n\n1. **Find slow commit transactions:** Run Query 3, focus on `commit_pct_of_service_lat > 20%`\n2. **Check for contention correlation:** Run Query 1 for same transaction fingerprints to see if contention is related\n3. **Analyze time patterns:** Group Query 3 by `aggregated_ts` to identify peak periods\n4. **Resource investigation:** Run Query 5 to check if network overhead correlates with commit latency\n5. **Remediate:** Consider batching operations, partitioning tables, or investigating replication configuration\n\n### Workflow 3: Statement Composition Drill-Down\n\n1. **Identify problematic transactions:** Run Query 1 or Query 3 to find high-retry or slow-commit transactions\n2. **Extract statement IDs:** Run Query 2 to see `stmtFingerprintIDs` for target transactions\n3. **Join with statement_statistics:** Run Query 7 to see full statement details\n4. **Optimize bottleneck statements:** Use profiling-statement-fingerprints skill to analyze and optimize identified statements\n5. **Validate retry reduction:** Re-run Query 1 after optimizations to confirm improved retry counts\n\n### Workflow 4: Application Health Scorecard\n\n1. **Generate retry metrics by app:** Run Query 4 to get application-level retry statistics\n2. **Correlate with commit latency:** Modify Query 3 to group by application\n3. **Resource attribution:** Run Query 5 grouped by application to see resource impact\n4. **Trend analysis:** Run queries with 7-day window and compare hourly buckets\n5. **Contact application teams:** Provide specific transaction fingerprints with high retries or latency for investigation\n\n## Safety Considerations\n\n**Read-only operations:**\nAll queries are `SELECT` statements against `crdb_internal.transaction_statistics`, which is production-approved and safe for diagnostic use.\n\n**Performance impact:**\n\n| Consideration | Impact | Mitigation |\n|---------------|--------|------------|\n| Large table | High transaction diversity = many rows | Always use `WHERE aggregated_ts > now() - INTERVAL '24 hours'` and `LIMIT` |\n| JSON parsing | CPU overhead for JSONB extraction | Avoid tight loops; use specific time windows |\n| Broad windows | 7-day queries = more rows | Default to 24h; expand only when needed |\n| Sampled metrics | NULL handling overhead | Use defensive `WHERE (statistics->'execution_statistics'->>'cnt') IS NOT NULL` |\n\n**Privacy:** Use `VIEWACTIVITYREDACTED` to redact query constants in multi-tenant environments (same as statement profiling).\n\n**Default time window:** 24 hours balances recent data with manageable result sets.\n\n## Troubleshooting\n\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| Empty results | No data in window, or stats collection disabled | Check `sql.stats.automatic_collection.enabled = true` |\n| `column does not exist` | JSON field typo or version mismatch | Verify field names; check CockroachDB version |\n| NULL in sampled metrics | Metric not sampled in bucket | Filter: `WHERE (statistics->'execution_statistics'->>'cnt') IS NOT NULL` |\n| `fingerprint_id` not hex | Default binary format | Use `encode(fingerprint_id, 'hex')` for readability |\n| Statement join fails | Mismatched aggregated_ts or fingerprint format | Ensure same time bucket and proper type casting with `decode()` |\n| Very slow query | Large table, no time filter | Always add time window and LIMIT |\n| Empty `stmtFingerprintIDs` | Single-statement transactions or old version | Normal for simple transactions |\n\n## Key Considerations\n\n- **Time windows:** Default to 24h; expand to 7d for trends\n- **Sampled metrics:** Not all executions captured; check sample size (`cnt`)\n- **JSON field safety:** Use defensive NULL checks; handle type casting errors\n- **Privacy:** Use VIEWACTIVITYREDACTED in production\n- **Performance:** Always include time filters and LIMIT clauses\n- **Complement to statement profiling:** Use together for complete coverage (transaction + statement)\n- **Complement to live triage:** Historical patterns vs real-time (use both)\n- **Data retention:** Bounded by the row-count cap `sql.stats.persisted_rows.max` (default 1,000,000), not a TTL; effective time window varies with workload diversity\n- **Retry semantics:** `maxRetries` is maximum across all executions in bucket, not average\n- **Fingerprint encoding:** Use `encode(fingerprint_id, 'hex')` for human-readable IDs\n\n## References\n\n**Skill references:**\n- [JSON field schema and extraction](references\u002Fjson-field-reference.md)\n- [Metrics catalog and units](references\u002Fmetrics-and-units.md)\n- [SQL query variations](references\u002Fsql-query-variations.md)\n- [RBAC and privileges](..\u002Ftriaging-live-sql-activity\u002Freferences\u002Fpermissions.md) (shared with triaging-live-sql-activity)\n\n**Official CockroachDB Documentation:**\n- [crdb_internal](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fcrdb-internal.html)\n- [Transactions Page (DB Console)](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fui-transactions-page.html)\n- [Monitor and Analyze Transaction Contention](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fmonitor-and-analyze-transaction-contention.html)\n- [VIEWACTIVITY privilege](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fsecurity-reference\u002Fauthorization.html#supported-privileges)\n\n**Related skills:**\n- [profiling-statement-fingerprints](..\u002Fprofiling-statement-fingerprints\u002FSKILL.md) - For statement-level optimization\n- [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md) - For immediate triage of active transactions\n",{"data":37,"body":41},{"name":4,"description":6,"compatibility":38,"metadata":39},"Requires SQL access with VIEWACTIVITY or VIEWACTIVITYREDACTED cluster privilege. Uses crdb_internal.transaction_statistics (production-safe). Execution statistics fields are sampled and may be sparse.",{"author":8,"version":40},"1.0",{"type":42,"children":43},"root",[44,52,67,87,104,111,146,174,180,231,239,269,282,288,295,305,313,346,352,398,404,510,528,542,548,553,561,608,616,674,682,721,733,739,749,759,769,777,825,831,837,973,1007,1017,1023,1140,1164,1173,1179,1324,1348,1357,1363,1483,1492,1502,1508,1659,1683,1692,1698,1843,1852,1858,2010,2019,2037,2043,2049,2109,2115,2181,2187,2248,2254,2307,2313,2338,2346,2464,2480,2490,2496,2687,2693,2821,2827,2835,2874,2882,2926,2934,2955],{"type":45,"tag":46,"props":47,"children":48},"element","h1",{"id":4},[49],{"type":50,"value":51},"text","Profiling Transaction Fingerprints",{"type":45,"tag":53,"props":54,"children":55},"p",{},[56,58,65],{"type":50,"value":57},"Analyzes historical transaction performance patterns using aggregated SQL statistics to identify high-retry transactions, contention patterns, and commit latency issues. Uses ",{"type":45,"tag":59,"props":60,"children":62},"code",{"className":61},[],[63],{"type":50,"value":64},"crdb_internal.transaction_statistics",{"type":50,"value":66}," for time-windowed analysis of retry behavior, commit latency, and statement composition - entirely via SQL without requiring DB Console access.",{"type":45,"tag":53,"props":68,"children":69},{},[70,76,78,85],{"type":45,"tag":71,"props":72,"children":73},"strong",{},[74],{"type":50,"value":75},"Complement to profiling-statement-fingerprints:",{"type":50,"value":77}," This skill analyzes transaction-level patterns (groups of statements with retry behavior); for statement-level optimization, see ",{"type":45,"tag":79,"props":80,"children":82},"a",{"href":81},"..\u002Fprofiling-statement-fingerprints\u002FSKILL.md",[83],{"type":50,"value":84},"profiling-statement-fingerprints",{"type":50,"value":86},".",{"type":45,"tag":53,"props":88,"children":89},{},[90,95,97,103],{"type":45,"tag":71,"props":91,"children":92},{},[93],{"type":50,"value":94},"Complement to triaging-live-sql-activity:",{"type":50,"value":96}," This skill analyzes historical transaction patterns; for immediate triage of currently active transactions, see ",{"type":45,"tag":79,"props":98,"children":100},{"href":99},"..\u002Ftriaging-live-sql-activity\u002FSKILL.md",[101],{"type":50,"value":102},"triaging-live-sql-activity",{"type":50,"value":86},{"type":45,"tag":105,"props":106,"children":108},"h2",{"id":107},"when-to-use-this-skill",[109],{"type":50,"value":110},"When to Use This Skill",{"type":45,"tag":112,"props":113,"children":114},"ul",{},[115,121,126,131,136,141],{"type":45,"tag":116,"props":117,"children":118},"li",{},[119],{"type":50,"value":120},"Identify transactions with high retry counts",{"type":45,"tag":116,"props":122,"children":123},{},[124],{"type":50,"value":125},"Analyze commit latency trends for transaction fingerprints",{"type":45,"tag":116,"props":127,"children":128},{},[129],{"type":50,"value":130},"Find transactions with high contention at transaction boundary",{"type":45,"tag":116,"props":132,"children":133},{},[134],{"type":50,"value":135},"Understand statement composition of problematic transactions",{"type":45,"tag":116,"props":137,"children":138},{},[139],{"type":50,"value":140},"Investigate transaction retry storms or abort patterns",{"type":45,"tag":116,"props":142,"children":143},{},[144],{"type":50,"value":145},"SQL-only historical transaction analysis without DB Console access",{"type":45,"tag":53,"props":147,"children":148},{},[149,154,156,160,162,167,168,172],{"type":45,"tag":71,"props":150,"children":151},{},[152],{"type":50,"value":153},"For immediate incident response:",{"type":50,"value":155}," Use ",{"type":45,"tag":79,"props":157,"children":158},{"href":99},[159],{"type":50,"value":102},{"type":50,"value":161}," to triage currently active transactions and cancel runaway work.\n",{"type":45,"tag":71,"props":163,"children":164},{},[165],{"type":50,"value":166},"For statement-level optimization:",{"type":50,"value":155},{"type":45,"tag":79,"props":169,"children":170},{"href":81},[171],{"type":50,"value":84},{"type":50,"value":173}," to analyze individual query patterns.",{"type":45,"tag":105,"props":175,"children":177},{"id":176},"prerequisites",[178],{"type":50,"value":179},"Prerequisites",{"type":45,"tag":112,"props":181,"children":182},{},[183,188,215,220],{"type":45,"tag":116,"props":184,"children":185},{},[186],{"type":50,"value":187},"SQL connection to CockroachDB cluster",{"type":45,"tag":116,"props":189,"children":190},{},[191,197,199,205,207],{"type":45,"tag":59,"props":192,"children":194},{"className":193},[],[195],{"type":50,"value":196},"VIEWACTIVITY",{"type":50,"value":198}," or ",{"type":45,"tag":59,"props":200,"children":202},{"className":201},[],[203],{"type":50,"value":204},"VIEWACTIVITYREDACTED",{"type":50,"value":206}," cluster privilege for cluster-wide visibility\n",{"type":45,"tag":112,"props":208,"children":209},{},[210],{"type":45,"tag":116,"props":211,"children":212},{},[213],{"type":50,"value":214},"Same privilege requirements as profiling-statement-fingerprints",{"type":45,"tag":116,"props":216,"children":217},{},[218],{"type":50,"value":219},"Understanding of transaction performance concepts",{"type":45,"tag":116,"props":221,"children":222},{},[223,225],{"type":50,"value":224},"Transaction statistics collection enabled (default): ",{"type":45,"tag":59,"props":226,"children":228},{"className":227},[],[229],{"type":50,"value":230},"sql.stats.automatic_collection.enabled = true",{"type":45,"tag":53,"props":232,"children":233},{},[234],{"type":45,"tag":71,"props":235,"children":236},{},[237],{"type":50,"value":238},"Check transaction stats collection:",{"type":45,"tag":240,"props":241,"children":246},"pre",{"className":242,"code":243,"language":244,"meta":245,"style":245},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","SHOW CLUSTER SETTING sql.stats.automatic_collection.enabled;\n-- Should return: true\n","sql","",[247],{"type":45,"tag":59,"props":248,"children":249},{"__ignoreMap":245},[250,261],{"type":45,"tag":251,"props":252,"children":255},"span",{"class":253,"line":254},"line",1,[256],{"type":45,"tag":251,"props":257,"children":258},{},[259],{"type":50,"value":260},"SHOW CLUSTER SETTING sql.stats.automatic_collection.enabled;\n",{"type":45,"tag":251,"props":262,"children":263},{"class":253,"line":26},[264],{"type":45,"tag":251,"props":265,"children":266},{},[267],{"type":50,"value":268},"-- Should return: true\n",{"type":45,"tag":53,"props":270,"children":271},{},[272,274,280],{"type":50,"value":273},"See ",{"type":45,"tag":79,"props":275,"children":277},{"href":276},"..\u002Ftriaging-live-sql-activity\u002Freferences\u002Fpermissions.md",[278],{"type":50,"value":279},"triaging-live-sql-activity permissions reference",{"type":50,"value":281}," for RBAC setup (same privileges).",{"type":45,"tag":105,"props":283,"children":285},{"id":284},"core-concepts",[286],{"type":50,"value":287},"Core Concepts",{"type":45,"tag":289,"props":290,"children":292},"h3",{"id":291},"transaction-fingerprints-vs-live-transactions",[293],{"type":50,"value":294},"Transaction Fingerprints vs Live Transactions",{"type":45,"tag":53,"props":296,"children":297},{},[298,303],{"type":45,"tag":71,"props":299,"children":300},{},[301],{"type":50,"value":302},"Transaction fingerprint:",{"type":50,"value":304}," Normalized transaction pattern grouping statements with parameterized constants.",{"type":45,"tag":53,"props":306,"children":307},{},[308],{"type":45,"tag":71,"props":309,"children":310},{},[311],{"type":50,"value":312},"Key differences:",{"type":45,"tag":112,"props":314,"children":315},{},[316,326,336],{"type":45,"tag":116,"props":317,"children":318},{},[319,324],{"type":45,"tag":71,"props":320,"children":321},{},[322],{"type":50,"value":323},"Time scope:",{"type":50,"value":325}," Historical hourly buckets vs real-time current state",{"type":45,"tag":116,"props":327,"children":328},{},[329,334],{"type":45,"tag":71,"props":330,"children":331},{},[332],{"type":50,"value":333},"Granularity:",{"type":50,"value":335}," Aggregated retry\u002Fcommit stats vs individual transaction instances",{"type":45,"tag":116,"props":337,"children":338},{},[339,344],{"type":45,"tag":71,"props":340,"children":341},{},[342],{"type":50,"value":343},"Relationship:",{"type":50,"value":345}," Transaction = collection of statement fingerprints",{"type":45,"tag":289,"props":347,"children":349},{"id":348},"time-series-bucketing",[350],{"type":50,"value":351},"Time-Series Bucketing",{"type":45,"tag":53,"props":353,"children":354},{},[355,360,362,368,370,375,377,383,385,390,392],{"type":45,"tag":71,"props":356,"children":357},{},[358],{"type":50,"value":359},"aggregated_ts:",{"type":50,"value":361}," Hourly UTC buckets (e.g., ",{"type":45,"tag":59,"props":363,"children":365},{"className":364},[],[366],{"type":50,"value":367},"2026-02-21 14:00:00",{"type":50,"value":369}," = 14:00-14:59 executions)\n",{"type":45,"tag":71,"props":371,"children":372},{},[373],{"type":50,"value":374},"Data retention:",{"type":50,"value":376}," Capped by row count, not time. ",{"type":45,"tag":59,"props":378,"children":380},{"className":379},[],[381],{"type":50,"value":382},"sql.stats.persisted_rows.max",{"type":50,"value":384}," (default 1,000,000) bounds the persisted statement+transaction rows; older buckets are compacted once the cap is reached. Effective wall-clock window depends on workload diversity.\n",{"type":45,"tag":71,"props":386,"children":387},{},[388],{"type":50,"value":389},"Best practice:",{"type":50,"value":391}," Always filter by time window: ",{"type":45,"tag":59,"props":393,"children":395},{"className":394},[],[396],{"type":50,"value":397},"WHERE aggregated_ts > now() - INTERVAL '24 hours'",{"type":45,"tag":289,"props":399,"children":401},{"id":400},"aggregated-vs-sampled-metrics",[402],{"type":50,"value":403},"Aggregated vs Sampled Metrics",{"type":45,"tag":405,"props":406,"children":407},"table",{},[408,437],{"type":45,"tag":409,"props":410,"children":411},"thead",{},[412],{"type":45,"tag":413,"props":414,"children":415},"tr",{},[416,422,427,432],{"type":45,"tag":417,"props":418,"children":419},"th",{},[420],{"type":50,"value":421},"Metric Category",{"type":45,"tag":417,"props":423,"children":424},{},[425],{"type":50,"value":426},"JSON Path",{"type":45,"tag":417,"props":428,"children":429},{},[430],{"type":50,"value":431},"Scope",{"type":45,"tag":417,"props":433,"children":434},{},[435],{"type":50,"value":436},"Use Case",{"type":45,"tag":438,"props":439,"children":440},"tbody",{},[441,472],{"type":45,"tag":413,"props":442,"children":443},{},[444,453,462,467],{"type":45,"tag":445,"props":446,"children":447},"td",{},[448],{"type":45,"tag":71,"props":449,"children":450},{},[451],{"type":50,"value":452},"Aggregated",{"type":45,"tag":445,"props":454,"children":455},{},[456],{"type":45,"tag":59,"props":457,"children":459},{"className":458},[],[460],{"type":50,"value":461},"statistics.statistics.*",{"type":45,"tag":445,"props":463,"children":464},{},[465],{"type":50,"value":466},"All executions",{"type":45,"tag":445,"props":468,"children":469},{},[470],{"type":50,"value":471},"Retries, commit latency, execution counts",{"type":45,"tag":413,"props":473,"children":474},{},[475,483,492,505],{"type":45,"tag":445,"props":476,"children":477},{},[478],{"type":45,"tag":71,"props":479,"children":480},{},[481],{"type":50,"value":482},"Sampled",{"type":45,"tag":445,"props":484,"children":485},{},[486],{"type":45,"tag":59,"props":487,"children":489},{"className":488},[],[490],{"type":50,"value":491},"statistics.execution_statistics.*",{"type":45,"tag":445,"props":493,"children":494},{},[495,497,503],{"type":50,"value":496},"Probabilistic sample governed by ",{"type":45,"tag":59,"props":498,"children":500},{"className":499},[],[501],{"type":50,"value":502},"sql.txn_stats.sample_rate",{"type":50,"value":504}," (default 0.01)",{"type":45,"tag":445,"props":506,"children":507},{},[508],{"type":50,"value":509},"Contention, network, memory\u002Fdisk",{"type":45,"tag":53,"props":511,"children":512},{},[513,518,520,526],{"type":45,"tag":71,"props":514,"children":515},{},[516],{"type":50,"value":517},"Critical:",{"type":50,"value":519}," Sampled metrics have ",{"type":45,"tag":59,"props":521,"children":523},{"className":522},[],[524],{"type":50,"value":525},"cnt",{"type":50,"value":527}," field showing sample size. Always check:",{"type":45,"tag":240,"props":529,"children":531},{"className":242,"code":530,"language":244,"meta":245,"style":245},"WHERE (statistics->'execution_statistics'->>'cnt') IS NOT NULL\n",[532],{"type":45,"tag":59,"props":533,"children":534},{"__ignoreMap":245},[535],{"type":45,"tag":251,"props":536,"children":537},{"class":253,"line":254},[538],{"type":45,"tag":251,"props":539,"children":540},{},[541],{"type":50,"value":530},{"type":45,"tag":289,"props":543,"children":545},{"id":544},"json-field-extraction",[546],{"type":50,"value":547},"JSON Field Extraction",{"type":45,"tag":53,"props":549,"children":550},{},[551],{"type":50,"value":552},"CockroachDB stores transaction metadata and statistics as JSONB. Use these operators:",{"type":45,"tag":53,"props":554,"children":555},{},[556],{"type":45,"tag":71,"props":557,"children":558},{},[559],{"type":50,"value":560},"Operators:",{"type":45,"tag":112,"props":562,"children":563},{},[564,575,586,597],{"type":45,"tag":116,"props":565,"children":566},{},[567,573],{"type":45,"tag":59,"props":568,"children":570},{"className":569},[],[571],{"type":50,"value":572},"->",{"type":50,"value":574},": Extract JSON object\u002Fvalue (returns JSON)",{"type":45,"tag":116,"props":576,"children":577},{},[578,584],{"type":45,"tag":59,"props":579,"children":581},{"className":580},[],[582],{"type":50,"value":583},"->>",{"type":50,"value":585},": Extract as text (returns text)",{"type":45,"tag":116,"props":587,"children":588},{},[589,595],{"type":45,"tag":59,"props":590,"children":592},{"className":591},[],[593],{"type":50,"value":594},"::TYPE",{"type":50,"value":596},": Cast to specific type",{"type":45,"tag":116,"props":598,"children":599},{},[600,606],{"type":45,"tag":59,"props":601,"children":603},{"className":602},[],[604],{"type":50,"value":605},"encode(fingerprint_id, 'hex')",{"type":50,"value":607},": Convert binary fingerprint to hex string",{"type":45,"tag":53,"props":609,"children":610},{},[611],{"type":45,"tag":71,"props":612,"children":613},{},[614],{"type":50,"value":615},"Transaction-specific examples:",{"type":45,"tag":240,"props":617,"children":619},{"className":242,"code":618,"language":244,"meta":245,"style":245},"encode(fingerprint_id, 'hex') AS txn_fingerprint_id                     -- Hex encoding\n(statistics->'statistics'->>'maxRetries')::INT                           -- Max retry count\n(statistics->'statistics'->'retryLat'->>'mean')::FLOAT8                  -- Retry latency (seconds)\n(statistics->'statistics'->'commitLat'->>'mean')::FLOAT8                 -- Commit latency (seconds)\n(statistics->'statistics'->'svcLat'->>'mean')::FLOAT8                    -- Service latency (seconds)\nmetadata->'stmtFingerprintIDs' AS stmt_fingerprint_ids_json             -- Statement composition\n",[620],{"type":45,"tag":59,"props":621,"children":622},{"__ignoreMap":245},[623,631,639,647,656,665],{"type":45,"tag":251,"props":624,"children":625},{"class":253,"line":254},[626],{"type":45,"tag":251,"props":627,"children":628},{},[629],{"type":50,"value":630},"encode(fingerprint_id, 'hex') AS txn_fingerprint_id                     -- Hex encoding\n",{"type":45,"tag":251,"props":632,"children":633},{"class":253,"line":26},[634],{"type":45,"tag":251,"props":635,"children":636},{},[637],{"type":50,"value":638},"(statistics->'statistics'->>'maxRetries')::INT                           -- Max retry count\n",{"type":45,"tag":251,"props":640,"children":641},{"class":253,"line":22},[642],{"type":45,"tag":251,"props":643,"children":644},{},[645],{"type":50,"value":646},"(statistics->'statistics'->'retryLat'->>'mean')::FLOAT8                  -- Retry latency (seconds)\n",{"type":45,"tag":251,"props":648,"children":650},{"class":253,"line":649},4,[651],{"type":45,"tag":251,"props":652,"children":653},{},[654],{"type":50,"value":655},"(statistics->'statistics'->'commitLat'->>'mean')::FLOAT8                 -- Commit latency (seconds)\n",{"type":45,"tag":251,"props":657,"children":659},{"class":253,"line":658},5,[660],{"type":45,"tag":251,"props":661,"children":662},{},[663],{"type":50,"value":664},"(statistics->'statistics'->'svcLat'->>'mean')::FLOAT8                    -- Service latency (seconds)\n",{"type":45,"tag":251,"props":666,"children":668},{"class":253,"line":667},6,[669],{"type":45,"tag":251,"props":670,"children":671},{},[672],{"type":50,"value":673},"metadata->'stmtFingerprintIDs' AS stmt_fingerprint_ids_json             -- Statement composition\n",{"type":45,"tag":53,"props":675,"children":676},{},[677],{"type":45,"tag":71,"props":678,"children":679},{},[680],{"type":50,"value":681},"Units:",{"type":45,"tag":112,"props":683,"children":684},{},[685,697,709],{"type":45,"tag":116,"props":686,"children":687},{},[688,690,695],{"type":50,"value":689},"Latency fields: ",{"type":45,"tag":71,"props":691,"children":692},{},[693],{"type":50,"value":694},"seconds",{"type":50,"value":696}," (FLOAT8)",{"type":45,"tag":116,"props":698,"children":699},{},[700,702,707],{"type":50,"value":701},"CPU\u002Fcontention: ",{"type":45,"tag":71,"props":703,"children":704},{},[705],{"type":50,"value":706},"nanoseconds",{"type":50,"value":708}," (divide by 1e9 for seconds)",{"type":45,"tag":116,"props":710,"children":711},{},[712,714,719],{"type":50,"value":713},"Memory\u002Fdisk: ",{"type":45,"tag":71,"props":715,"children":716},{},[717],{"type":50,"value":718},"bytes",{"type":50,"value":720}," (consider \u002F 1048576 for MB)",{"type":45,"tag":53,"props":722,"children":723},{},[724,725,731],{"type":50,"value":273},{"type":45,"tag":79,"props":726,"children":728},{"href":727},"references\u002Fjson-field-reference.md",[729],{"type":50,"value":730},"JSON field reference",{"type":50,"value":732}," for complete schema.",{"type":45,"tag":289,"props":734,"children":736},{"id":735},"statement-composition",[737],{"type":50,"value":738},"Statement Composition",{"type":45,"tag":53,"props":740,"children":741},{},[742,747],{"type":45,"tag":71,"props":743,"children":744},{},[745],{"type":50,"value":746},"metadata.stmtFingerprintIDs:",{"type":50,"value":748}," JSONB array mapping transaction to constituent statements",{"type":45,"tag":53,"props":750,"children":751},{},[752,757],{"type":45,"tag":71,"props":753,"children":754},{},[755],{"type":50,"value":756},"Use case:",{"type":50,"value":758}," Understand which statements compose high-retry transactions",{"type":45,"tag":53,"props":760,"children":761},{},[762,767],{"type":45,"tag":71,"props":763,"children":764},{},[765],{"type":50,"value":766},"Cross-reference workflow:",{"type":50,"value":768}," Join transaction_statistics with statement_statistics on fingerprint IDs",{"type":45,"tag":53,"props":770,"children":771},{},[772],{"type":45,"tag":71,"props":773,"children":774},{},[775],{"type":50,"value":776},"Example pattern:",{"type":45,"tag":240,"props":778,"children":780},{"className":242,"code":779,"language":244,"meta":245,"style":245},"-- Extract statement fingerprint IDs from transaction\nmetadata -> 'stmtFingerprintIDs' AS stmt_ids\n\n-- Use with jsonb_array_elements_text to expand and join\njsonb_array_elements_text(metadata->'stmtFingerprintIDs') AS stmt_fingerprint_id\n",[781],{"type":45,"tag":59,"props":782,"children":783},{"__ignoreMap":245},[784,792,800,809,817],{"type":45,"tag":251,"props":785,"children":786},{"class":253,"line":254},[787],{"type":45,"tag":251,"props":788,"children":789},{},[790],{"type":50,"value":791},"-- Extract statement fingerprint IDs from transaction\n",{"type":45,"tag":251,"props":793,"children":794},{"class":253,"line":26},[795],{"type":45,"tag":251,"props":796,"children":797},{},[798],{"type":50,"value":799},"metadata -> 'stmtFingerprintIDs' AS stmt_ids\n",{"type":45,"tag":251,"props":801,"children":802},{"class":253,"line":22},[803],{"type":45,"tag":251,"props":804,"children":806},{"emptyLinePlaceholder":805},true,[807],{"type":50,"value":808},"\n",{"type":45,"tag":251,"props":810,"children":811},{"class":253,"line":649},[812],{"type":45,"tag":251,"props":813,"children":814},{},[815],{"type":50,"value":816},"-- Use with jsonb_array_elements_text to expand and join\n",{"type":45,"tag":251,"props":818,"children":819},{"class":253,"line":658},[820],{"type":45,"tag":251,"props":821,"children":822},{},[823],{"type":50,"value":824},"jsonb_array_elements_text(metadata->'stmtFingerprintIDs') AS stmt_fingerprint_id\n",{"type":45,"tag":105,"props":826,"children":828},{"id":827},"core-diagnostic-queries",[829],{"type":50,"value":830},"Core Diagnostic Queries",{"type":45,"tag":289,"props":832,"children":834},{"id":833},"query-1-top-transactions-by-retries-and-contention",[835],{"type":50,"value":836},"Query 1: Top Transactions by Retries and Contention",{"type":45,"tag":240,"props":838,"children":840},{"className":242,"code":839,"language":244,"meta":245,"style":245},"-- Identify transactions with high retry counts and contention\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'db' AS database,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n  (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 AS mean_retry_lat_seconds,\n  (statistics->'execution_statistics'->'contentionTime'->>'mean')::FLOAT8 \u002F 1e9 AS mean_contention_seconds,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->>'maxRetries')::INT > 0\nORDER BY (statistics->'statistics'->>'maxRetries')::INT DESC\nLIMIT 20;\n",[841],{"type":45,"tag":59,"props":842,"children":843},{"__ignoreMap":245},[844,852,860,868,876,884,892,901,910,919,928,937,946,955,964],{"type":45,"tag":251,"props":845,"children":846},{"class":253,"line":254},[847],{"type":45,"tag":251,"props":848,"children":849},{},[850],{"type":50,"value":851},"-- Identify transactions with high retry counts and contention\n",{"type":45,"tag":251,"props":853,"children":854},{"class":253,"line":26},[855],{"type":45,"tag":251,"props":856,"children":857},{},[858],{"type":50,"value":859},"SELECT\n",{"type":45,"tag":251,"props":861,"children":862},{"class":253,"line":22},[863],{"type":45,"tag":251,"props":864,"children":865},{},[866],{"type":50,"value":867},"  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n",{"type":45,"tag":251,"props":869,"children":870},{"class":253,"line":649},[871],{"type":45,"tag":251,"props":872,"children":873},{},[874],{"type":50,"value":875},"  metadata->>'db' AS database,\n",{"type":45,"tag":251,"props":877,"children":878},{"class":253,"line":658},[879],{"type":45,"tag":251,"props":880,"children":881},{},[882],{"type":50,"value":883},"  metadata->>'app' AS application,\n",{"type":45,"tag":251,"props":885,"children":886},{"class":253,"line":667},[887],{"type":45,"tag":251,"props":888,"children":889},{},[890],{"type":50,"value":891},"  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n",{"type":45,"tag":251,"props":893,"children":895},{"class":253,"line":894},7,[896],{"type":45,"tag":251,"props":897,"children":898},{},[899],{"type":50,"value":900},"  (statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n",{"type":45,"tag":251,"props":902,"children":904},{"class":253,"line":903},8,[905],{"type":45,"tag":251,"props":906,"children":907},{},[908],{"type":50,"value":909},"  (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 AS mean_retry_lat_seconds,\n",{"type":45,"tag":251,"props":911,"children":913},{"class":253,"line":912},9,[914],{"type":45,"tag":251,"props":915,"children":916},{},[917],{"type":50,"value":918},"  (statistics->'execution_statistics'->'contentionTime'->>'mean')::FLOAT8 \u002F 1e9 AS mean_contention_seconds,\n",{"type":45,"tag":251,"props":920,"children":922},{"class":253,"line":921},10,[923],{"type":45,"tag":251,"props":924,"children":925},{},[926],{"type":50,"value":927},"  aggregated_ts\n",{"type":45,"tag":251,"props":929,"children":931},{"class":253,"line":930},11,[932],{"type":45,"tag":251,"props":933,"children":934},{},[935],{"type":50,"value":936},"FROM crdb_internal.transaction_statistics\n",{"type":45,"tag":251,"props":938,"children":940},{"class":253,"line":939},12,[941],{"type":45,"tag":251,"props":942,"children":943},{},[944],{"type":50,"value":945},"WHERE aggregated_ts > now() - INTERVAL '24 hours'\n",{"type":45,"tag":251,"props":947,"children":949},{"class":253,"line":948},13,[950],{"type":45,"tag":251,"props":951,"children":952},{},[953],{"type":50,"value":954},"  AND (statistics->'statistics'->>'maxRetries')::INT > 0\n",{"type":45,"tag":251,"props":956,"children":958},{"class":253,"line":957},14,[959],{"type":45,"tag":251,"props":960,"children":961},{},[962],{"type":50,"value":963},"ORDER BY (statistics->'statistics'->>'maxRetries')::INT DESC\n",{"type":45,"tag":251,"props":965,"children":967},{"class":253,"line":966},15,[968],{"type":45,"tag":251,"props":969,"children":970},{},[971],{"type":50,"value":972},"LIMIT 20;\n",{"type":45,"tag":53,"props":974,"children":975},{},[976,981,983,989,991,997,999,1005],{"type":45,"tag":71,"props":977,"children":978},{},[979],{"type":50,"value":980},"Key columns:",{"type":50,"value":982}," ",{"type":45,"tag":59,"props":984,"children":986},{"className":985},[],[987],{"type":50,"value":988},"max_retries",{"type":50,"value":990}," shows maximum retry count; ",{"type":45,"tag":59,"props":992,"children":994},{"className":993},[],[995],{"type":50,"value":996},"mean_retry_lat_seconds",{"type":50,"value":998}," shows time spent in retries; ",{"type":45,"tag":59,"props":1000,"children":1002},{"className":1001},[],[1003],{"type":50,"value":1004},"mean_contention_seconds",{"type":50,"value":1006}," shows lock wait time.",{"type":45,"tag":53,"props":1008,"children":1009},{},[1010,1015],{"type":45,"tag":71,"props":1011,"children":1012},{},[1013],{"type":50,"value":1014},"Interpretation:",{"type":50,"value":1016}," High max_retries (>10) indicates transaction conflicts; correlate with contention to identify lock hotspots.",{"type":45,"tag":289,"props":1018,"children":1020},{"id":1019},"query-2-statement-composition-analysis",[1021],{"type":50,"value":1022},"Query 2: Statement Composition Analysis",{"type":45,"tag":240,"props":1024,"children":1026},{"className":242,"code":1025,"language":244,"meta":245,"style":245},"-- Extract statement fingerprints for high-retry transactions\nSELECT\n  encode(t.fingerprint_id, 'hex') AS txn_fingerprint_id,\n  t.metadata->>'app' AS application,\n  (t.statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n  jsonb_array_length(t.metadata->'stmtFingerprintIDs') AS num_statements,\n  t.metadata->'stmtFingerprintIDs' AS stmt_fingerprint_ids,\n  t.aggregated_ts\nFROM crdb_internal.transaction_statistics t\nWHERE t.aggregated_ts > now() - INTERVAL '24 hours'\n  AND (t.statistics->'statistics'->>'maxRetries')::INT > 10\n  AND t.metadata->'stmtFingerprintIDs' IS NOT NULL\nORDER BY max_retries DESC\nLIMIT 20;\n",[1027],{"type":45,"tag":59,"props":1028,"children":1029},{"__ignoreMap":245},[1030,1038,1045,1053,1061,1069,1077,1085,1093,1101,1109,1117,1125,1133],{"type":45,"tag":251,"props":1031,"children":1032},{"class":253,"line":254},[1033],{"type":45,"tag":251,"props":1034,"children":1035},{},[1036],{"type":50,"value":1037},"-- Extract statement fingerprints for high-retry transactions\n",{"type":45,"tag":251,"props":1039,"children":1040},{"class":253,"line":26},[1041],{"type":45,"tag":251,"props":1042,"children":1043},{},[1044],{"type":50,"value":859},{"type":45,"tag":251,"props":1046,"children":1047},{"class":253,"line":22},[1048],{"type":45,"tag":251,"props":1049,"children":1050},{},[1051],{"type":50,"value":1052},"  encode(t.fingerprint_id, 'hex') AS txn_fingerprint_id,\n",{"type":45,"tag":251,"props":1054,"children":1055},{"class":253,"line":649},[1056],{"type":45,"tag":251,"props":1057,"children":1058},{},[1059],{"type":50,"value":1060},"  t.metadata->>'app' AS application,\n",{"type":45,"tag":251,"props":1062,"children":1063},{"class":253,"line":658},[1064],{"type":45,"tag":251,"props":1065,"children":1066},{},[1067],{"type":50,"value":1068},"  (t.statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n",{"type":45,"tag":251,"props":1070,"children":1071},{"class":253,"line":667},[1072],{"type":45,"tag":251,"props":1073,"children":1074},{},[1075],{"type":50,"value":1076},"  jsonb_array_length(t.metadata->'stmtFingerprintIDs') AS num_statements,\n",{"type":45,"tag":251,"props":1078,"children":1079},{"class":253,"line":894},[1080],{"type":45,"tag":251,"props":1081,"children":1082},{},[1083],{"type":50,"value":1084},"  t.metadata->'stmtFingerprintIDs' AS stmt_fingerprint_ids,\n",{"type":45,"tag":251,"props":1086,"children":1087},{"class":253,"line":903},[1088],{"type":45,"tag":251,"props":1089,"children":1090},{},[1091],{"type":50,"value":1092},"  t.aggregated_ts\n",{"type":45,"tag":251,"props":1094,"children":1095},{"class":253,"line":912},[1096],{"type":45,"tag":251,"props":1097,"children":1098},{},[1099],{"type":50,"value":1100},"FROM crdb_internal.transaction_statistics t\n",{"type":45,"tag":251,"props":1102,"children":1103},{"class":253,"line":921},[1104],{"type":45,"tag":251,"props":1105,"children":1106},{},[1107],{"type":50,"value":1108},"WHERE t.aggregated_ts > now() - INTERVAL '24 hours'\n",{"type":45,"tag":251,"props":1110,"children":1111},{"class":253,"line":930},[1112],{"type":45,"tag":251,"props":1113,"children":1114},{},[1115],{"type":50,"value":1116},"  AND (t.statistics->'statistics'->>'maxRetries')::INT > 10\n",{"type":45,"tag":251,"props":1118,"children":1119},{"class":253,"line":939},[1120],{"type":45,"tag":251,"props":1121,"children":1122},{},[1123],{"type":50,"value":1124},"  AND t.metadata->'stmtFingerprintIDs' IS NOT NULL\n",{"type":45,"tag":251,"props":1126,"children":1127},{"class":253,"line":948},[1128],{"type":45,"tag":251,"props":1129,"children":1130},{},[1131],{"type":50,"value":1132},"ORDER BY max_retries DESC\n",{"type":45,"tag":251,"props":1134,"children":1135},{"class":253,"line":957},[1136],{"type":45,"tag":251,"props":1137,"children":1138},{},[1139],{"type":50,"value":972},{"type":45,"tag":53,"props":1141,"children":1142},{},[1143,1147,1148,1154,1156,1162],{"type":45,"tag":71,"props":1144,"children":1145},{},[1146],{"type":50,"value":980},{"type":50,"value":982},{"type":45,"tag":59,"props":1149,"children":1151},{"className":1150},[],[1152],{"type":50,"value":1153},"num_statements",{"type":50,"value":1155}," shows transaction complexity; ",{"type":45,"tag":59,"props":1157,"children":1159},{"className":1158},[],[1160],{"type":50,"value":1161},"stmt_fingerprint_ids",{"type":50,"value":1163}," contains statement IDs for cross-reference with statement_statistics.",{"type":45,"tag":53,"props":1165,"children":1166},{},[1167,1171],{"type":45,"tag":71,"props":1168,"children":1169},{},[1170],{"type":50,"value":756},{"type":50,"value":1172}," Understand which statement combinations cause retries; use Query 7 to drill down to specific statements.",{"type":45,"tag":289,"props":1174,"children":1176},{"id":1175},"query-3-high-commit-latency-transactions",[1177],{"type":50,"value":1178},"Query 3: High Commit Latency Transactions",{"type":45,"tag":240,"props":1180,"children":1182},{"className":242,"code":1181,"language":244,"meta":245,"style":245},"-- Find transactions with slow commit latency\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'db' AS database,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 AS mean_commit_lat_seconds,\n  (statistics->'statistics'->'svcLat'->>'mean')::FLOAT8 AS mean_service_lat_seconds,\n  ROUND(\n    ((statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 \u002F\n    NULLIF((statistics->'statistics'->'svcLat'->>'mean')::FLOAT8, 0)) * 100, 2\n  ) AS commit_pct_of_service_lat,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 > 0.1  -- > 100ms commit latency\nORDER BY (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 DESC\nLIMIT 20;\n",[1183],{"type":45,"tag":59,"props":1184,"children":1185},{"__ignoreMap":245},[1186,1194,1201,1208,1215,1222,1229,1237,1245,1253,1261,1269,1277,1284,1291,1298,1307,1316],{"type":45,"tag":251,"props":1187,"children":1188},{"class":253,"line":254},[1189],{"type":45,"tag":251,"props":1190,"children":1191},{},[1192],{"type":50,"value":1193},"-- Find transactions with slow commit latency\n",{"type":45,"tag":251,"props":1195,"children":1196},{"class":253,"line":26},[1197],{"type":45,"tag":251,"props":1198,"children":1199},{},[1200],{"type":50,"value":859},{"type":45,"tag":251,"props":1202,"children":1203},{"class":253,"line":22},[1204],{"type":45,"tag":251,"props":1205,"children":1206},{},[1207],{"type":50,"value":867},{"type":45,"tag":251,"props":1209,"children":1210},{"class":253,"line":649},[1211],{"type":45,"tag":251,"props":1212,"children":1213},{},[1214],{"type":50,"value":875},{"type":45,"tag":251,"props":1216,"children":1217},{"class":253,"line":658},[1218],{"type":45,"tag":251,"props":1219,"children":1220},{},[1221],{"type":50,"value":883},{"type":45,"tag":251,"props":1223,"children":1224},{"class":253,"line":667},[1225],{"type":45,"tag":251,"props":1226,"children":1227},{},[1228],{"type":50,"value":891},{"type":45,"tag":251,"props":1230,"children":1231},{"class":253,"line":894},[1232],{"type":45,"tag":251,"props":1233,"children":1234},{},[1235],{"type":50,"value":1236},"  (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 AS mean_commit_lat_seconds,\n",{"type":45,"tag":251,"props":1238,"children":1239},{"class":253,"line":903},[1240],{"type":45,"tag":251,"props":1241,"children":1242},{},[1243],{"type":50,"value":1244},"  (statistics->'statistics'->'svcLat'->>'mean')::FLOAT8 AS mean_service_lat_seconds,\n",{"type":45,"tag":251,"props":1246,"children":1247},{"class":253,"line":912},[1248],{"type":45,"tag":251,"props":1249,"children":1250},{},[1251],{"type":50,"value":1252},"  ROUND(\n",{"type":45,"tag":251,"props":1254,"children":1255},{"class":253,"line":921},[1256],{"type":45,"tag":251,"props":1257,"children":1258},{},[1259],{"type":50,"value":1260},"    ((statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 \u002F\n",{"type":45,"tag":251,"props":1262,"children":1263},{"class":253,"line":930},[1264],{"type":45,"tag":251,"props":1265,"children":1266},{},[1267],{"type":50,"value":1268},"    NULLIF((statistics->'statistics'->'svcLat'->>'mean')::FLOAT8, 0)) * 100, 2\n",{"type":45,"tag":251,"props":1270,"children":1271},{"class":253,"line":939},[1272],{"type":45,"tag":251,"props":1273,"children":1274},{},[1275],{"type":50,"value":1276},"  ) AS commit_pct_of_service_lat,\n",{"type":45,"tag":251,"props":1278,"children":1279},{"class":253,"line":948},[1280],{"type":45,"tag":251,"props":1281,"children":1282},{},[1283],{"type":50,"value":927},{"type":45,"tag":251,"props":1285,"children":1286},{"class":253,"line":957},[1287],{"type":45,"tag":251,"props":1288,"children":1289},{},[1290],{"type":50,"value":936},{"type":45,"tag":251,"props":1292,"children":1293},{"class":253,"line":966},[1294],{"type":45,"tag":251,"props":1295,"children":1296},{},[1297],{"type":50,"value":945},{"type":45,"tag":251,"props":1299,"children":1301},{"class":253,"line":1300},16,[1302],{"type":45,"tag":251,"props":1303,"children":1304},{},[1305],{"type":50,"value":1306},"  AND (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 > 0.1  -- > 100ms commit latency\n",{"type":45,"tag":251,"props":1308,"children":1310},{"class":253,"line":1309},17,[1311],{"type":45,"tag":251,"props":1312,"children":1313},{},[1314],{"type":50,"value":1315},"ORDER BY (statistics->'statistics'->'commitLat'->>'mean')::FLOAT8 DESC\n",{"type":45,"tag":251,"props":1317,"children":1319},{"class":253,"line":1318},18,[1320],{"type":45,"tag":251,"props":1321,"children":1322},{},[1323],{"type":50,"value":972},{"type":45,"tag":53,"props":1325,"children":1326},{},[1327,1331,1332,1338,1340,1346],{"type":45,"tag":71,"props":1328,"children":1329},{},[1330],{"type":50,"value":980},{"type":50,"value":982},{"type":45,"tag":59,"props":1333,"children":1335},{"className":1334},[],[1336],{"type":50,"value":1337},"mean_commit_lat_seconds",{"type":50,"value":1339}," shows 2PC commit time; ",{"type":45,"tag":59,"props":1341,"children":1343},{"className":1342},[],[1344],{"type":50,"value":1345},"commit_pct_of_service_lat",{"type":50,"value":1347}," shows what percentage of total latency is commit overhead.",{"type":45,"tag":53,"props":1349,"children":1350},{},[1351,1355],{"type":45,"tag":71,"props":1352,"children":1353},{},[1354],{"type":50,"value":1014},{"type":50,"value":1356}," High commit percentage (>20%) suggests distributed transaction overhead, replication delays, or cross-region writes.",{"type":45,"tag":289,"props":1358,"children":1360},{"id":1359},"query-4-retry-rate-by-application",[1361],{"type":50,"value":1362},"Query 4: Retry Rate by Application",{"type":45,"tag":240,"props":1364,"children":1366},{"className":242,"code":1365,"language":244,"meta":245,"style":245},"-- Analyze retry patterns by application\nSELECT\n  metadata->>'app' AS application,\n  metadata->>'db' AS database,\n  COUNT(*) AS transaction_fingerprint_count,\n  SUM((statistics->'statistics'->>'cnt')::INT) AS total_executions,\n  AVG((statistics->'statistics'->>'maxRetries')::INT) AS avg_max_retries,\n  MAX((statistics->'statistics'->>'maxRetries')::INT) AS overall_max_retries,\n  AVG((statistics->'statistics'->'retryLat'->>'mean')::FLOAT8) AS avg_retry_lat_seconds\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->>'maxRetries')::INT > 0\nGROUP BY metadata->>'app', metadata->>'db'\nORDER BY avg_max_retries DESC\nLIMIT 20;\n",[1367],{"type":45,"tag":59,"props":1368,"children":1369},{"__ignoreMap":245},[1370,1378,1385,1392,1399,1407,1415,1423,1431,1439,1446,1453,1460,1468,1476],{"type":45,"tag":251,"props":1371,"children":1372},{"class":253,"line":254},[1373],{"type":45,"tag":251,"props":1374,"children":1375},{},[1376],{"type":50,"value":1377},"-- Analyze retry patterns by application\n",{"type":45,"tag":251,"props":1379,"children":1380},{"class":253,"line":26},[1381],{"type":45,"tag":251,"props":1382,"children":1383},{},[1384],{"type":50,"value":859},{"type":45,"tag":251,"props":1386,"children":1387},{"class":253,"line":22},[1388],{"type":45,"tag":251,"props":1389,"children":1390},{},[1391],{"type":50,"value":883},{"type":45,"tag":251,"props":1393,"children":1394},{"class":253,"line":649},[1395],{"type":45,"tag":251,"props":1396,"children":1397},{},[1398],{"type":50,"value":875},{"type":45,"tag":251,"props":1400,"children":1401},{"class":253,"line":658},[1402],{"type":45,"tag":251,"props":1403,"children":1404},{},[1405],{"type":50,"value":1406},"  COUNT(*) AS transaction_fingerprint_count,\n",{"type":45,"tag":251,"props":1408,"children":1409},{"class":253,"line":667},[1410],{"type":45,"tag":251,"props":1411,"children":1412},{},[1413],{"type":50,"value":1414},"  SUM((statistics->'statistics'->>'cnt')::INT) AS total_executions,\n",{"type":45,"tag":251,"props":1416,"children":1417},{"class":253,"line":894},[1418],{"type":45,"tag":251,"props":1419,"children":1420},{},[1421],{"type":50,"value":1422},"  AVG((statistics->'statistics'->>'maxRetries')::INT) AS avg_max_retries,\n",{"type":45,"tag":251,"props":1424,"children":1425},{"class":253,"line":903},[1426],{"type":45,"tag":251,"props":1427,"children":1428},{},[1429],{"type":50,"value":1430},"  MAX((statistics->'statistics'->>'maxRetries')::INT) AS overall_max_retries,\n",{"type":45,"tag":251,"props":1432,"children":1433},{"class":253,"line":912},[1434],{"type":45,"tag":251,"props":1435,"children":1436},{},[1437],{"type":50,"value":1438},"  AVG((statistics->'statistics'->'retryLat'->>'mean')::FLOAT8) AS avg_retry_lat_seconds\n",{"type":45,"tag":251,"props":1440,"children":1441},{"class":253,"line":921},[1442],{"type":45,"tag":251,"props":1443,"children":1444},{},[1445],{"type":50,"value":936},{"type":45,"tag":251,"props":1447,"children":1448},{"class":253,"line":930},[1449],{"type":45,"tag":251,"props":1450,"children":1451},{},[1452],{"type":50,"value":945},{"type":45,"tag":251,"props":1454,"children":1455},{"class":253,"line":939},[1456],{"type":45,"tag":251,"props":1457,"children":1458},{},[1459],{"type":50,"value":954},{"type":45,"tag":251,"props":1461,"children":1462},{"class":253,"line":948},[1463],{"type":45,"tag":251,"props":1464,"children":1465},{},[1466],{"type":50,"value":1467},"GROUP BY metadata->>'app', metadata->>'db'\n",{"type":45,"tag":251,"props":1469,"children":1470},{"class":253,"line":957},[1471],{"type":45,"tag":251,"props":1472,"children":1473},{},[1474],{"type":50,"value":1475},"ORDER BY avg_max_retries DESC\n",{"type":45,"tag":251,"props":1477,"children":1478},{"class":253,"line":966},[1479],{"type":45,"tag":251,"props":1480,"children":1481},{},[1482],{"type":50,"value":972},{"type":45,"tag":53,"props":1484,"children":1485},{},[1486,1490],{"type":45,"tag":71,"props":1487,"children":1488},{},[1489],{"type":50,"value":756},{"type":50,"value":1491}," Application-level health scorecard; identify which applications have the most problematic transaction patterns.",{"type":45,"tag":53,"props":1493,"children":1494},{},[1495,1500],{"type":45,"tag":71,"props":1496,"children":1497},{},[1498],{"type":50,"value":1499},"Customization:",{"type":50,"value":1501}," Adjust time window to 7 days for trends; filter by specific database.",{"type":45,"tag":289,"props":1503,"children":1505},{"id":1504},"query-5-transaction-resource-consumption",[1506],{"type":50,"value":1507},"Query 5: Transaction Resource Consumption",{"type":45,"tag":240,"props":1509,"children":1511},{"className":242,"code":1510,"language":244,"meta":245,"style":245},"-- Find transactions with high resource usage\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 \u002F 1048576 AS mean_network_mb,\n  (statistics->'execution_statistics'->'maxMemUsage'->>'mean')::FLOAT8 \u002F 1048576 AS mean_mem_mb,\n  (statistics->'execution_statistics'->'maxDiskUsage'->>'mean')::FLOAT8 \u002F 1048576 AS mean_disk_mb,\n  ROUND(\n    ((statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 \u002F 1048576) *\n    (statistics->'statistics'->>'cnt')::INT, 2\n  ) AS estimated_total_network_mb,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'execution_statistics'->>'cnt') IS NOT NULL\n  AND (statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 > 0\nORDER BY estimated_total_network_mb DESC\nLIMIT 20;\n",[1512],{"type":45,"tag":59,"props":1513,"children":1514},{"__ignoreMap":245},[1515,1523,1530,1537,1544,1551,1559,1567,1575,1582,1590,1598,1606,1613,1620,1627,1635,1643,1651],{"type":45,"tag":251,"props":1516,"children":1517},{"class":253,"line":254},[1518],{"type":45,"tag":251,"props":1519,"children":1520},{},[1521],{"type":50,"value":1522},"-- Find transactions with high resource usage\n",{"type":45,"tag":251,"props":1524,"children":1525},{"class":253,"line":26},[1526],{"type":45,"tag":251,"props":1527,"children":1528},{},[1529],{"type":50,"value":859},{"type":45,"tag":251,"props":1531,"children":1532},{"class":253,"line":22},[1533],{"type":45,"tag":251,"props":1534,"children":1535},{},[1536],{"type":50,"value":867},{"type":45,"tag":251,"props":1538,"children":1539},{"class":253,"line":649},[1540],{"type":45,"tag":251,"props":1541,"children":1542},{},[1543],{"type":50,"value":883},{"type":45,"tag":251,"props":1545,"children":1546},{"class":253,"line":658},[1547],{"type":45,"tag":251,"props":1548,"children":1549},{},[1550],{"type":50,"value":891},{"type":45,"tag":251,"props":1552,"children":1553},{"class":253,"line":667},[1554],{"type":45,"tag":251,"props":1555,"children":1556},{},[1557],{"type":50,"value":1558},"  (statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 \u002F 1048576 AS mean_network_mb,\n",{"type":45,"tag":251,"props":1560,"children":1561},{"class":253,"line":894},[1562],{"type":45,"tag":251,"props":1563,"children":1564},{},[1565],{"type":50,"value":1566},"  (statistics->'execution_statistics'->'maxMemUsage'->>'mean')::FLOAT8 \u002F 1048576 AS mean_mem_mb,\n",{"type":45,"tag":251,"props":1568,"children":1569},{"class":253,"line":903},[1570],{"type":45,"tag":251,"props":1571,"children":1572},{},[1573],{"type":50,"value":1574},"  (statistics->'execution_statistics'->'maxDiskUsage'->>'mean')::FLOAT8 \u002F 1048576 AS mean_disk_mb,\n",{"type":45,"tag":251,"props":1576,"children":1577},{"class":253,"line":912},[1578],{"type":45,"tag":251,"props":1579,"children":1580},{},[1581],{"type":50,"value":1252},{"type":45,"tag":251,"props":1583,"children":1584},{"class":253,"line":921},[1585],{"type":45,"tag":251,"props":1586,"children":1587},{},[1588],{"type":50,"value":1589},"    ((statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 \u002F 1048576) *\n",{"type":45,"tag":251,"props":1591,"children":1592},{"class":253,"line":930},[1593],{"type":45,"tag":251,"props":1594,"children":1595},{},[1596],{"type":50,"value":1597},"    (statistics->'statistics'->>'cnt')::INT, 2\n",{"type":45,"tag":251,"props":1599,"children":1600},{"class":253,"line":939},[1601],{"type":45,"tag":251,"props":1602,"children":1603},{},[1604],{"type":50,"value":1605},"  ) AS estimated_total_network_mb,\n",{"type":45,"tag":251,"props":1607,"children":1608},{"class":253,"line":948},[1609],{"type":45,"tag":251,"props":1610,"children":1611},{},[1612],{"type":50,"value":927},{"type":45,"tag":251,"props":1614,"children":1615},{"class":253,"line":957},[1616],{"type":45,"tag":251,"props":1617,"children":1618},{},[1619],{"type":50,"value":936},{"type":45,"tag":251,"props":1621,"children":1622},{"class":253,"line":966},[1623],{"type":45,"tag":251,"props":1624,"children":1625},{},[1626],{"type":50,"value":945},{"type":45,"tag":251,"props":1628,"children":1629},{"class":253,"line":1300},[1630],{"type":45,"tag":251,"props":1631,"children":1632},{},[1633],{"type":50,"value":1634},"  AND (statistics->'execution_statistics'->>'cnt') IS NOT NULL\n",{"type":45,"tag":251,"props":1636,"children":1637},{"class":253,"line":1309},[1638],{"type":45,"tag":251,"props":1639,"children":1640},{},[1641],{"type":50,"value":1642},"  AND (statistics->'execution_statistics'->'networkBytes'->>'mean')::FLOAT8 > 0\n",{"type":45,"tag":251,"props":1644,"children":1645},{"class":253,"line":1318},[1646],{"type":45,"tag":251,"props":1647,"children":1648},{},[1649],{"type":50,"value":1650},"ORDER BY estimated_total_network_mb DESC\n",{"type":45,"tag":251,"props":1652,"children":1654},{"class":253,"line":1653},19,[1655],{"type":45,"tag":251,"props":1656,"children":1657},{},[1658],{"type":50,"value":972},{"type":45,"tag":53,"props":1660,"children":1661},{},[1662,1666,1667,1673,1675,1681],{"type":45,"tag":71,"props":1663,"children":1664},{},[1665],{"type":50,"value":980},{"type":50,"value":982},{"type":45,"tag":59,"props":1668,"children":1670},{"className":1669},[],[1671],{"type":50,"value":1672},"mean_network_mb",{"type":50,"value":1674}," shows distributed transaction overhead; ",{"type":45,"tag":59,"props":1676,"children":1678},{"className":1677},[],[1679],{"type":50,"value":1680},"mean_disk_mb",{"type":50,"value":1682}," > 0 indicates memory spill.",{"type":45,"tag":53,"props":1684,"children":1685},{},[1686,1690],{"type":45,"tag":71,"props":1687,"children":1688},{},[1689],{"type":50,"value":1014},{"type":50,"value":1691}," High network bytes suggest cross-region transactions or inefficient distribution; disk usage indicates memory pressure.",{"type":45,"tag":289,"props":1693,"children":1695},{"id":1694},"query-6-retry-latency-decomposition",[1696],{"type":50,"value":1697},"Query 6: Retry Latency Decomposition",{"type":45,"tag":240,"props":1699,"children":1701},{"className":242,"code":1700,"language":244,"meta":245,"style":245},"-- Understand retry latency as percentage of service latency\nSELECT\n  encode(fingerprint_id, 'hex') AS txn_fingerprint_id,\n  metadata->>'app' AS application,\n  (statistics->'statistics'->>'cnt')::INT AS execution_count,\n  (statistics->'statistics'->>'maxRetries')::INT AS max_retries,\n  (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 AS mean_retry_lat_seconds,\n  (statistics->'statistics'->'svcLat'->>'mean')::FLOAT8 AS mean_service_lat_seconds,\n  ROUND(\n    ((statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 \u002F\n    NULLIF((statistics->'statistics'->'svcLat'->>'mean')::FLOAT8, 0)) * 100, 2\n  ) AS retry_pct_of_service_lat,\n  aggregated_ts\nFROM crdb_internal.transaction_statistics\nWHERE aggregated_ts > now() - INTERVAL '24 hours'\n  AND (statistics->'statistics'->>'maxRetries')::INT > 0\n  AND (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 > 0\nORDER BY retry_pct_of_service_lat DESC\nLIMIT 20;\n",[1702],{"type":45,"tag":59,"props":1703,"children":1704},{"__ignoreMap":245},[1705,1713,1720,1727,1734,1741,1748,1755,1762,1769,1777,1784,1792,1799,1806,1813,1820,1828,1836],{"type":45,"tag":251,"props":1706,"children":1707},{"class":253,"line":254},[1708],{"type":45,"tag":251,"props":1709,"children":1710},{},[1711],{"type":50,"value":1712},"-- Understand retry latency as percentage of service latency\n",{"type":45,"tag":251,"props":1714,"children":1715},{"class":253,"line":26},[1716],{"type":45,"tag":251,"props":1717,"children":1718},{},[1719],{"type":50,"value":859},{"type":45,"tag":251,"props":1721,"children":1722},{"class":253,"line":22},[1723],{"type":45,"tag":251,"props":1724,"children":1725},{},[1726],{"type":50,"value":867},{"type":45,"tag":251,"props":1728,"children":1729},{"class":253,"line":649},[1730],{"type":45,"tag":251,"props":1731,"children":1732},{},[1733],{"type":50,"value":883},{"type":45,"tag":251,"props":1735,"children":1736},{"class":253,"line":658},[1737],{"type":45,"tag":251,"props":1738,"children":1739},{},[1740],{"type":50,"value":891},{"type":45,"tag":251,"props":1742,"children":1743},{"class":253,"line":667},[1744],{"type":45,"tag":251,"props":1745,"children":1746},{},[1747],{"type":50,"value":900},{"type":45,"tag":251,"props":1749,"children":1750},{"class":253,"line":894},[1751],{"type":45,"tag":251,"props":1752,"children":1753},{},[1754],{"type":50,"value":909},{"type":45,"tag":251,"props":1756,"children":1757},{"class":253,"line":903},[1758],{"type":45,"tag":251,"props":1759,"children":1760},{},[1761],{"type":50,"value":1244},{"type":45,"tag":251,"props":1763,"children":1764},{"class":253,"line":912},[1765],{"type":45,"tag":251,"props":1766,"children":1767},{},[1768],{"type":50,"value":1252},{"type":45,"tag":251,"props":1770,"children":1771},{"class":253,"line":921},[1772],{"type":45,"tag":251,"props":1773,"children":1774},{},[1775],{"type":50,"value":1776},"    ((statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 \u002F\n",{"type":45,"tag":251,"props":1778,"children":1779},{"class":253,"line":930},[1780],{"type":45,"tag":251,"props":1781,"children":1782},{},[1783],{"type":50,"value":1268},{"type":45,"tag":251,"props":1785,"children":1786},{"class":253,"line":939},[1787],{"type":45,"tag":251,"props":1788,"children":1789},{},[1790],{"type":50,"value":1791},"  ) AS retry_pct_of_service_lat,\n",{"type":45,"tag":251,"props":1793,"children":1794},{"class":253,"line":948},[1795],{"type":45,"tag":251,"props":1796,"children":1797},{},[1798],{"type":50,"value":927},{"type":45,"tag":251,"props":1800,"children":1801},{"class":253,"line":957},[1802],{"type":45,"tag":251,"props":1803,"children":1804},{},[1805],{"type":50,"value":936},{"type":45,"tag":251,"props":1807,"children":1808},{"class":253,"line":966},[1809],{"type":45,"tag":251,"props":1810,"children":1811},{},[1812],{"type":50,"value":945},{"type":45,"tag":251,"props":1814,"children":1815},{"class":253,"line":1300},[1816],{"type":45,"tag":251,"props":1817,"children":1818},{},[1819],{"type":50,"value":954},{"type":45,"tag":251,"props":1821,"children":1822},{"class":253,"line":1309},[1823],{"type":45,"tag":251,"props":1824,"children":1825},{},[1826],{"type":50,"value":1827},"  AND (statistics->'statistics'->'retryLat'->>'mean')::FLOAT8 > 0\n",{"type":45,"tag":251,"props":1829,"children":1830},{"class":253,"line":1318},[1831],{"type":45,"tag":251,"props":1832,"children":1833},{},[1834],{"type":50,"value":1835},"ORDER BY retry_pct_of_service_lat DESC\n",{"type":45,"tag":251,"props":1837,"children":1838},{"class":253,"line":1653},[1839],{"type":45,"tag":251,"props":1840,"children":1841},{},[1842],{"type":50,"value":972},{"type":45,"tag":53,"props":1844,"children":1845},{},[1846,1850],{"type":45,"tag":71,"props":1847,"children":1848},{},[1849],{"type":50,"value":1014},{"type":50,"value":1851}," High retry percentage (>30%) means most latency is spent retrying due to contention; optimize transaction boundaries or schema.",{"type":45,"tag":289,"props":1853,"children":1855},{"id":1854},"query-7-cross-reference-transaction-to-statements",[1856],{"type":50,"value":1857},"Query 7: Cross-Reference Transaction to Statements",{"type":45,"tag":240,"props":1859,"children":1861},{"className":242,"code":1860,"language":244,"meta":245,"style":245},"-- Join transaction statistics with statement statistics to see constituent statements\nSELECT\n  encode(t.fingerprint_id, 'hex') AS txn_fingerprint_id,\n  t.metadata->>'app' AS txn_application,\n  (t.statistics->'statistics'->>'maxRetries')::INT AS txn_max_retries,\n  stmt_fp_id AS stmt_fingerprint_id,\n  s.metadata->>'query' AS statement_query,\n  (s.statistics->'statistics'->'runLat'->>'mean')::FLOAT8 AS stmt_mean_run_lat_seconds,\n  t.aggregated_ts\nFROM crdb_internal.transaction_statistics t\nCROSS JOIN LATERAL jsonb_array_elements_text(t.metadata->'stmtFingerprintIDs') AS stmt_fp_id\nLEFT JOIN crdb_internal.statement_statistics s\n  ON s.fingerprint_id = decode(stmt_fp_id, 'hex')\n  AND s.aggregated_ts = t.aggregated_ts\nWHERE t.aggregated_ts > now() - INTERVAL '24 hours'\n  AND (t.statistics->'statistics'->>'maxRetries')::INT > 10\n  AND t.metadata->'stmtFingerprintIDs' IS NOT NULL\nORDER BY txn_max_retries DESC, stmt_mean_run_lat_seconds DESC\nLIMIT 50;\n",[1862],{"type":45,"tag":59,"props":1863,"children":1864},{"__ignoreMap":245},[1865,1873,1880,1887,1895,1903,1911,1919,1927,1934,1941,1949,1957,1965,1973,1980,1987,1994,2002],{"type":45,"tag":251,"props":1866,"children":1867},{"class":253,"line":254},[1868],{"type":45,"tag":251,"props":1869,"children":1870},{},[1871],{"type":50,"value":1872},"-- Join transaction statistics with statement statistics to see constituent statements\n",{"type":45,"tag":251,"props":1874,"children":1875},{"class":253,"line":26},[1876],{"type":45,"tag":251,"props":1877,"children":1878},{},[1879],{"type":50,"value":859},{"type":45,"tag":251,"props":1881,"children":1882},{"class":253,"line":22},[1883],{"type":45,"tag":251,"props":1884,"children":1885},{},[1886],{"type":50,"value":1052},{"type":45,"tag":251,"props":1888,"children":1889},{"class":253,"line":649},[1890],{"type":45,"tag":251,"props":1891,"children":1892},{},[1893],{"type":50,"value":1894},"  t.metadata->>'app' AS txn_application,\n",{"type":45,"tag":251,"props":1896,"children":1897},{"class":253,"line":658},[1898],{"type":45,"tag":251,"props":1899,"children":1900},{},[1901],{"type":50,"value":1902},"  (t.statistics->'statistics'->>'maxRetries')::INT AS txn_max_retries,\n",{"type":45,"tag":251,"props":1904,"children":1905},{"class":253,"line":667},[1906],{"type":45,"tag":251,"props":1907,"children":1908},{},[1909],{"type":50,"value":1910},"  stmt_fp_id AS stmt_fingerprint_id,\n",{"type":45,"tag":251,"props":1912,"children":1913},{"class":253,"line":894},[1914],{"type":45,"tag":251,"props":1915,"children":1916},{},[1917],{"type":50,"value":1918},"  s.metadata->>'query' AS statement_query,\n",{"type":45,"tag":251,"props":1920,"children":1921},{"class":253,"line":903},[1922],{"type":45,"tag":251,"props":1923,"children":1924},{},[1925],{"type":50,"value":1926},"  (s.statistics->'statistics'->'runLat'->>'mean')::FLOAT8 AS stmt_mean_run_lat_seconds,\n",{"type":45,"tag":251,"props":1928,"children":1929},{"class":253,"line":912},[1930],{"type":45,"tag":251,"props":1931,"children":1932},{},[1933],{"type":50,"value":1092},{"type":45,"tag":251,"props":1935,"children":1936},{"class":253,"line":921},[1937],{"type":45,"tag":251,"props":1938,"children":1939},{},[1940],{"type":50,"value":1100},{"type":45,"tag":251,"props":1942,"children":1943},{"class":253,"line":930},[1944],{"type":45,"tag":251,"props":1945,"children":1946},{},[1947],{"type":50,"value":1948},"CROSS JOIN LATERAL jsonb_array_elements_text(t.metadata->'stmtFingerprintIDs') AS stmt_fp_id\n",{"type":45,"tag":251,"props":1950,"children":1951},{"class":253,"line":939},[1952],{"type":45,"tag":251,"props":1953,"children":1954},{},[1955],{"type":50,"value":1956},"LEFT JOIN crdb_internal.statement_statistics s\n",{"type":45,"tag":251,"props":1958,"children":1959},{"class":253,"line":948},[1960],{"type":45,"tag":251,"props":1961,"children":1962},{},[1963],{"type":50,"value":1964},"  ON s.fingerprint_id = decode(stmt_fp_id, 'hex')\n",{"type":45,"tag":251,"props":1966,"children":1967},{"class":253,"line":957},[1968],{"type":45,"tag":251,"props":1969,"children":1970},{},[1971],{"type":50,"value":1972},"  AND s.aggregated_ts = t.aggregated_ts\n",{"type":45,"tag":251,"props":1974,"children":1975},{"class":253,"line":966},[1976],{"type":45,"tag":251,"props":1977,"children":1978},{},[1979],{"type":50,"value":1108},{"type":45,"tag":251,"props":1981,"children":1982},{"class":253,"line":1300},[1983],{"type":45,"tag":251,"props":1984,"children":1985},{},[1986],{"type":50,"value":1116},{"type":45,"tag":251,"props":1988,"children":1989},{"class":253,"line":1309},[1990],{"type":45,"tag":251,"props":1991,"children":1992},{},[1993],{"type":50,"value":1124},{"type":45,"tag":251,"props":1995,"children":1996},{"class":253,"line":1318},[1997],{"type":45,"tag":251,"props":1998,"children":1999},{},[2000],{"type":50,"value":2001},"ORDER BY txn_max_retries DESC, stmt_mean_run_lat_seconds DESC\n",{"type":45,"tag":251,"props":2003,"children":2004},{"class":253,"line":1653},[2005],{"type":45,"tag":251,"props":2006,"children":2007},{},[2008],{"type":50,"value":2009},"LIMIT 50;\n",{"type":45,"tag":53,"props":2011,"children":2012},{},[2013,2017],{"type":45,"tag":71,"props":2014,"children":2015},{},[2016],{"type":50,"value":756},{"type":50,"value":2018}," Drill down from high-retry transactions to specific problematic statements; identify which statement in a transaction is causing retries.",{"type":45,"tag":53,"props":2020,"children":2021},{},[2022,2027,2029,2035],{"type":45,"tag":71,"props":2023,"children":2024},{},[2025],{"type":50,"value":2026},"Note:",{"type":50,"value":2028}," Uses ",{"type":45,"tag":59,"props":2030,"children":2032},{"className":2031},[],[2033],{"type":50,"value":2034},"decode(stmt_fp_id, 'hex')",{"type":50,"value":2036}," to convert hex string back to binary for join with statement_statistics.",{"type":45,"tag":105,"props":2038,"children":2040},{"id":2039},"common-workflows",[2041],{"type":50,"value":2042},"Common Workflows",{"type":45,"tag":289,"props":2044,"children":2046},{"id":2045},"workflow-1-retry-storm-investigation",[2047],{"type":50,"value":2048},"Workflow 1: Retry Storm Investigation",{"type":45,"tag":2050,"props":2051,"children":2052},"ol",{},[2053,2069,2079,2089,2099],{"type":45,"tag":116,"props":2054,"children":2055},{},[2056,2061,2063],{"type":45,"tag":71,"props":2057,"children":2058},{},[2059],{"type":50,"value":2060},"Identify high-retry transactions:",{"type":50,"value":2062}," Run Query 1, focus on ",{"type":45,"tag":59,"props":2064,"children":2066},{"className":2065},[],[2067],{"type":50,"value":2068},"max_retries > 20",{"type":45,"tag":116,"props":2070,"children":2071},{},[2072,2077],{"type":45,"tag":71,"props":2073,"children":2074},{},[2075],{"type":50,"value":2076},"Analyze retry patterns by application:",{"type":50,"value":2078}," Run Query 4 to identify problematic apps",{"type":45,"tag":116,"props":2080,"children":2081},{},[2082,2087],{"type":45,"tag":71,"props":2083,"children":2084},{},[2085],{"type":50,"value":2086},"Examine statement composition:",{"type":50,"value":2088}," Run Query 7 to see which statements are in high-retry transactions",{"type":45,"tag":116,"props":2090,"children":2091},{},[2092,2097],{"type":45,"tag":71,"props":2093,"children":2094},{},[2095],{"type":50,"value":2096},"Cross-reference live activity:",{"type":50,"value":2098}," If ongoing, use triaging-live-sql-activity to check current transaction state",{"type":45,"tag":116,"props":2100,"children":2101},{},[2102,2107],{"type":45,"tag":71,"props":2103,"children":2104},{},[2105],{"type":50,"value":2106},"Remediate:",{"type":50,"value":2108}," Adjust transaction boundaries, batch operations, optimize statements identified in step 3",{"type":45,"tag":289,"props":2110,"children":2112},{"id":2111},"workflow-2-commit-latency-analysis",[2113],{"type":50,"value":2114},"Workflow 2: Commit Latency Analysis",{"type":45,"tag":2050,"props":2116,"children":2117},{},[2118,2134,2144,2162,2172],{"type":45,"tag":116,"props":2119,"children":2120},{},[2121,2126,2128],{"type":45,"tag":71,"props":2122,"children":2123},{},[2124],{"type":50,"value":2125},"Find slow commit transactions:",{"type":50,"value":2127}," Run Query 3, focus on ",{"type":45,"tag":59,"props":2129,"children":2131},{"className":2130},[],[2132],{"type":50,"value":2133},"commit_pct_of_service_lat > 20%",{"type":45,"tag":116,"props":2135,"children":2136},{},[2137,2142],{"type":45,"tag":71,"props":2138,"children":2139},{},[2140],{"type":50,"value":2141},"Check for contention correlation:",{"type":50,"value":2143}," Run Query 1 for same transaction fingerprints to see if contention is related",{"type":45,"tag":116,"props":2145,"children":2146},{},[2147,2152,2154,2160],{"type":45,"tag":71,"props":2148,"children":2149},{},[2150],{"type":50,"value":2151},"Analyze time patterns:",{"type":50,"value":2153}," Group Query 3 by ",{"type":45,"tag":59,"props":2155,"children":2157},{"className":2156},[],[2158],{"type":50,"value":2159},"aggregated_ts",{"type":50,"value":2161}," to identify peak periods",{"type":45,"tag":116,"props":2163,"children":2164},{},[2165,2170],{"type":45,"tag":71,"props":2166,"children":2167},{},[2168],{"type":50,"value":2169},"Resource investigation:",{"type":50,"value":2171}," Run Query 5 to check if network overhead correlates with commit latency",{"type":45,"tag":116,"props":2173,"children":2174},{},[2175,2179],{"type":45,"tag":71,"props":2176,"children":2177},{},[2178],{"type":50,"value":2106},{"type":50,"value":2180}," Consider batching operations, partitioning tables, or investigating replication configuration",{"type":45,"tag":289,"props":2182,"children":2184},{"id":2183},"workflow-3-statement-composition-drill-down",[2185],{"type":50,"value":2186},"Workflow 3: Statement Composition Drill-Down",{"type":45,"tag":2050,"props":2188,"children":2189},{},[2190,2200,2218,2228,2238],{"type":45,"tag":116,"props":2191,"children":2192},{},[2193,2198],{"type":45,"tag":71,"props":2194,"children":2195},{},[2196],{"type":50,"value":2197},"Identify problematic transactions:",{"type":50,"value":2199}," Run Query 1 or Query 3 to find high-retry or slow-commit transactions",{"type":45,"tag":116,"props":2201,"children":2202},{},[2203,2208,2210,2216],{"type":45,"tag":71,"props":2204,"children":2205},{},[2206],{"type":50,"value":2207},"Extract statement IDs:",{"type":50,"value":2209}," Run Query 2 to see ",{"type":45,"tag":59,"props":2211,"children":2213},{"className":2212},[],[2214],{"type":50,"value":2215},"stmtFingerprintIDs",{"type":50,"value":2217}," for target transactions",{"type":45,"tag":116,"props":2219,"children":2220},{},[2221,2226],{"type":45,"tag":71,"props":2222,"children":2223},{},[2224],{"type":50,"value":2225},"Join with statement_statistics:",{"type":50,"value":2227}," Run Query 7 to see full statement details",{"type":45,"tag":116,"props":2229,"children":2230},{},[2231,2236],{"type":45,"tag":71,"props":2232,"children":2233},{},[2234],{"type":50,"value":2235},"Optimize bottleneck statements:",{"type":50,"value":2237}," Use profiling-statement-fingerprints skill to analyze and optimize identified statements",{"type":45,"tag":116,"props":2239,"children":2240},{},[2241,2246],{"type":45,"tag":71,"props":2242,"children":2243},{},[2244],{"type":50,"value":2245},"Validate retry reduction:",{"type":50,"value":2247}," Re-run Query 1 after optimizations to confirm improved retry counts",{"type":45,"tag":289,"props":2249,"children":2251},{"id":2250},"workflow-4-application-health-scorecard",[2252],{"type":50,"value":2253},"Workflow 4: Application Health Scorecard",{"type":45,"tag":2050,"props":2255,"children":2256},{},[2257,2267,2277,2287,2297],{"type":45,"tag":116,"props":2258,"children":2259},{},[2260,2265],{"type":45,"tag":71,"props":2261,"children":2262},{},[2263],{"type":50,"value":2264},"Generate retry metrics by app:",{"type":50,"value":2266}," Run Query 4 to get application-level retry statistics",{"type":45,"tag":116,"props":2268,"children":2269},{},[2270,2275],{"type":45,"tag":71,"props":2271,"children":2272},{},[2273],{"type":50,"value":2274},"Correlate with commit latency:",{"type":50,"value":2276}," Modify Query 3 to group by application",{"type":45,"tag":116,"props":2278,"children":2279},{},[2280,2285],{"type":45,"tag":71,"props":2281,"children":2282},{},[2283],{"type":50,"value":2284},"Resource attribution:",{"type":50,"value":2286}," Run Query 5 grouped by application to see resource impact",{"type":45,"tag":116,"props":2288,"children":2289},{},[2290,2295],{"type":45,"tag":71,"props":2291,"children":2292},{},[2293],{"type":50,"value":2294},"Trend analysis:",{"type":50,"value":2296}," Run queries with 7-day window and compare hourly buckets",{"type":45,"tag":116,"props":2298,"children":2299},{},[2300,2305],{"type":45,"tag":71,"props":2301,"children":2302},{},[2303],{"type":50,"value":2304},"Contact application teams:",{"type":50,"value":2306}," Provide specific transaction fingerprints with high retries or latency for investigation",{"type":45,"tag":105,"props":2308,"children":2310},{"id":2309},"safety-considerations",[2311],{"type":50,"value":2312},"Safety Considerations",{"type":45,"tag":53,"props":2314,"children":2315},{},[2316,2321,2323,2329,2331,2336],{"type":45,"tag":71,"props":2317,"children":2318},{},[2319],{"type":50,"value":2320},"Read-only operations:",{"type":50,"value":2322},"\nAll queries are ",{"type":45,"tag":59,"props":2324,"children":2326},{"className":2325},[],[2327],{"type":50,"value":2328},"SELECT",{"type":50,"value":2330}," statements against ",{"type":45,"tag":59,"props":2332,"children":2334},{"className":2333},[],[2335],{"type":50,"value":64},{"type":50,"value":2337},", which is production-approved and safe for diagnostic use.",{"type":45,"tag":53,"props":2339,"children":2340},{},[2341],{"type":45,"tag":71,"props":2342,"children":2343},{},[2344],{"type":50,"value":2345},"Performance impact:",{"type":45,"tag":405,"props":2347,"children":2348},{},[2349,2370],{"type":45,"tag":409,"props":2350,"children":2351},{},[2352],{"type":45,"tag":413,"props":2353,"children":2354},{},[2355,2360,2365],{"type":45,"tag":417,"props":2356,"children":2357},{},[2358],{"type":50,"value":2359},"Consideration",{"type":45,"tag":417,"props":2361,"children":2362},{},[2363],{"type":50,"value":2364},"Impact",{"type":45,"tag":417,"props":2366,"children":2367},{},[2368],{"type":50,"value":2369},"Mitigation",{"type":45,"tag":438,"props":2371,"children":2372},{},[2373,2404,2422,2440],{"type":45,"tag":413,"props":2374,"children":2375},{},[2376,2381,2386],{"type":45,"tag":445,"props":2377,"children":2378},{},[2379],{"type":50,"value":2380},"Large table",{"type":45,"tag":445,"props":2382,"children":2383},{},[2384],{"type":50,"value":2385},"High transaction diversity = many rows",{"type":45,"tag":445,"props":2387,"children":2388},{},[2389,2391,2396,2398],{"type":50,"value":2390},"Always use ",{"type":45,"tag":59,"props":2392,"children":2394},{"className":2393},[],[2395],{"type":50,"value":397},{"type":50,"value":2397}," and ",{"type":45,"tag":59,"props":2399,"children":2401},{"className":2400},[],[2402],{"type":50,"value":2403},"LIMIT",{"type":45,"tag":413,"props":2405,"children":2406},{},[2407,2412,2417],{"type":45,"tag":445,"props":2408,"children":2409},{},[2410],{"type":50,"value":2411},"JSON parsing",{"type":45,"tag":445,"props":2413,"children":2414},{},[2415],{"type":50,"value":2416},"CPU overhead for JSONB extraction",{"type":45,"tag":445,"props":2418,"children":2419},{},[2420],{"type":50,"value":2421},"Avoid tight loops; use specific time windows",{"type":45,"tag":413,"props":2423,"children":2424},{},[2425,2430,2435],{"type":45,"tag":445,"props":2426,"children":2427},{},[2428],{"type":50,"value":2429},"Broad windows",{"type":45,"tag":445,"props":2431,"children":2432},{},[2433],{"type":50,"value":2434},"7-day queries = more rows",{"type":45,"tag":445,"props":2436,"children":2437},{},[2438],{"type":50,"value":2439},"Default to 24h; expand only when needed",{"type":45,"tag":413,"props":2441,"children":2442},{},[2443,2448,2453],{"type":45,"tag":445,"props":2444,"children":2445},{},[2446],{"type":50,"value":2447},"Sampled metrics",{"type":45,"tag":445,"props":2449,"children":2450},{},[2451],{"type":50,"value":2452},"NULL handling overhead",{"type":45,"tag":445,"props":2454,"children":2455},{},[2456,2458],{"type":50,"value":2457},"Use defensive ",{"type":45,"tag":59,"props":2459,"children":2461},{"className":2460},[],[2462],{"type":50,"value":2463},"WHERE (statistics->'execution_statistics'->>'cnt') IS NOT NULL",{"type":45,"tag":53,"props":2465,"children":2466},{},[2467,2472,2473,2478],{"type":45,"tag":71,"props":2468,"children":2469},{},[2470],{"type":50,"value":2471},"Privacy:",{"type":50,"value":155},{"type":45,"tag":59,"props":2474,"children":2476},{"className":2475},[],[2477],{"type":50,"value":204},{"type":50,"value":2479}," to redact query constants in multi-tenant environments (same as statement profiling).",{"type":45,"tag":53,"props":2481,"children":2482},{},[2483,2488],{"type":45,"tag":71,"props":2484,"children":2485},{},[2486],{"type":50,"value":2487},"Default time window:",{"type":50,"value":2489}," 24 hours balances recent data with manageable result sets.",{"type":45,"tag":105,"props":2491,"children":2493},{"id":2492},"troubleshooting",[2494],{"type":50,"value":2495},"Troubleshooting",{"type":45,"tag":405,"props":2497,"children":2498},{},[2499,2520],{"type":45,"tag":409,"props":2500,"children":2501},{},[2502],{"type":45,"tag":413,"props":2503,"children":2504},{},[2505,2510,2515],{"type":45,"tag":417,"props":2506,"children":2507},{},[2508],{"type":50,"value":2509},"Issue",{"type":45,"tag":417,"props":2511,"children":2512},{},[2513],{"type":50,"value":2514},"Cause",{"type":45,"tag":417,"props":2516,"children":2517},{},[2518],{"type":50,"value":2519},"Fix",{"type":45,"tag":438,"props":2521,"children":2522},{},[2523,2546,2568,2591,2622,2646,2664],{"type":45,"tag":413,"props":2524,"children":2525},{},[2526,2531,2536],{"type":45,"tag":445,"props":2527,"children":2528},{},[2529],{"type":50,"value":2530},"Empty results",{"type":45,"tag":445,"props":2532,"children":2533},{},[2534],{"type":50,"value":2535},"No data in window, or stats collection disabled",{"type":45,"tag":445,"props":2537,"children":2538},{},[2539,2541],{"type":50,"value":2540},"Check ",{"type":45,"tag":59,"props":2542,"children":2544},{"className":2543},[],[2545],{"type":50,"value":230},{"type":45,"tag":413,"props":2547,"children":2548},{},[2549,2558,2563],{"type":45,"tag":445,"props":2550,"children":2551},{},[2552],{"type":45,"tag":59,"props":2553,"children":2555},{"className":2554},[],[2556],{"type":50,"value":2557},"column does not exist",{"type":45,"tag":445,"props":2559,"children":2560},{},[2561],{"type":50,"value":2562},"JSON field typo or version mismatch",{"type":45,"tag":445,"props":2564,"children":2565},{},[2566],{"type":50,"value":2567},"Verify field names; check CockroachDB version",{"type":45,"tag":413,"props":2569,"children":2570},{},[2571,2576,2581],{"type":45,"tag":445,"props":2572,"children":2573},{},[2574],{"type":50,"value":2575},"NULL in sampled metrics",{"type":45,"tag":445,"props":2577,"children":2578},{},[2579],{"type":50,"value":2580},"Metric not sampled in bucket",{"type":45,"tag":445,"props":2582,"children":2583},{},[2584,2586],{"type":50,"value":2585},"Filter: ",{"type":45,"tag":59,"props":2587,"children":2589},{"className":2588},[],[2590],{"type":50,"value":2463},{"type":45,"tag":413,"props":2592,"children":2593},{},[2594,2605,2610],{"type":45,"tag":445,"props":2595,"children":2596},{},[2597,2603],{"type":45,"tag":59,"props":2598,"children":2600},{"className":2599},[],[2601],{"type":50,"value":2602},"fingerprint_id",{"type":50,"value":2604}," not hex",{"type":45,"tag":445,"props":2606,"children":2607},{},[2608],{"type":50,"value":2609},"Default binary format",{"type":45,"tag":445,"props":2611,"children":2612},{},[2613,2615,2620],{"type":50,"value":2614},"Use ",{"type":45,"tag":59,"props":2616,"children":2618},{"className":2617},[],[2619],{"type":50,"value":605},{"type":50,"value":2621}," for readability",{"type":45,"tag":413,"props":2623,"children":2624},{},[2625,2630,2635],{"type":45,"tag":445,"props":2626,"children":2627},{},[2628],{"type":50,"value":2629},"Statement join fails",{"type":45,"tag":445,"props":2631,"children":2632},{},[2633],{"type":50,"value":2634},"Mismatched aggregated_ts or fingerprint format",{"type":45,"tag":445,"props":2636,"children":2637},{},[2638,2640],{"type":50,"value":2639},"Ensure same time bucket and proper type casting with ",{"type":45,"tag":59,"props":2641,"children":2643},{"className":2642},[],[2644],{"type":50,"value":2645},"decode()",{"type":45,"tag":413,"props":2647,"children":2648},{},[2649,2654,2659],{"type":45,"tag":445,"props":2650,"children":2651},{},[2652],{"type":50,"value":2653},"Very slow query",{"type":45,"tag":445,"props":2655,"children":2656},{},[2657],{"type":50,"value":2658},"Large table, no time filter",{"type":45,"tag":445,"props":2660,"children":2661},{},[2662],{"type":50,"value":2663},"Always add time window and LIMIT",{"type":45,"tag":413,"props":2665,"children":2666},{},[2667,2677,2682],{"type":45,"tag":445,"props":2668,"children":2669},{},[2670,2672],{"type":50,"value":2671},"Empty ",{"type":45,"tag":59,"props":2673,"children":2675},{"className":2674},[],[2676],{"type":50,"value":2215},{"type":45,"tag":445,"props":2678,"children":2679},{},[2680],{"type":50,"value":2681},"Single-statement transactions or old version",{"type":45,"tag":445,"props":2683,"children":2684},{},[2685],{"type":50,"value":2686},"Normal for simple transactions",{"type":45,"tag":105,"props":2688,"children":2690},{"id":2689},"key-considerations",[2691],{"type":50,"value":2692},"Key Considerations",{"type":45,"tag":112,"props":2694,"children":2695},{},[2696,2706,2723,2733,2742,2752,2762,2772,2788,2805],{"type":45,"tag":116,"props":2697,"children":2698},{},[2699,2704],{"type":45,"tag":71,"props":2700,"children":2701},{},[2702],{"type":50,"value":2703},"Time windows:",{"type":50,"value":2705}," Default to 24h; expand to 7d for trends",{"type":45,"tag":116,"props":2707,"children":2708},{},[2709,2714,2716,2721],{"type":45,"tag":71,"props":2710,"children":2711},{},[2712],{"type":50,"value":2713},"Sampled metrics:",{"type":50,"value":2715}," Not all executions captured; check sample size (",{"type":45,"tag":59,"props":2717,"children":2719},{"className":2718},[],[2720],{"type":50,"value":525},{"type":50,"value":2722},")",{"type":45,"tag":116,"props":2724,"children":2725},{},[2726,2731],{"type":45,"tag":71,"props":2727,"children":2728},{},[2729],{"type":50,"value":2730},"JSON field safety:",{"type":50,"value":2732}," Use defensive NULL checks; handle type casting errors",{"type":45,"tag":116,"props":2734,"children":2735},{},[2736,2740],{"type":45,"tag":71,"props":2737,"children":2738},{},[2739],{"type":50,"value":2471},{"type":50,"value":2741}," Use VIEWACTIVITYREDACTED in production",{"type":45,"tag":116,"props":2743,"children":2744},{},[2745,2750],{"type":45,"tag":71,"props":2746,"children":2747},{},[2748],{"type":50,"value":2749},"Performance:",{"type":50,"value":2751}," Always include time filters and LIMIT clauses",{"type":45,"tag":116,"props":2753,"children":2754},{},[2755,2760],{"type":45,"tag":71,"props":2756,"children":2757},{},[2758],{"type":50,"value":2759},"Complement to statement profiling:",{"type":50,"value":2761}," Use together for complete coverage (transaction + statement)",{"type":45,"tag":116,"props":2763,"children":2764},{},[2765,2770],{"type":45,"tag":71,"props":2766,"children":2767},{},[2768],{"type":50,"value":2769},"Complement to live triage:",{"type":50,"value":2771}," Historical patterns vs real-time (use both)",{"type":45,"tag":116,"props":2773,"children":2774},{},[2775,2779,2781,2786],{"type":45,"tag":71,"props":2776,"children":2777},{},[2778],{"type":50,"value":374},{"type":50,"value":2780}," Bounded by the row-count cap ",{"type":45,"tag":59,"props":2782,"children":2784},{"className":2783},[],[2785],{"type":50,"value":382},{"type":50,"value":2787}," (default 1,000,000), not a TTL; effective time window varies with workload diversity",{"type":45,"tag":116,"props":2789,"children":2790},{},[2791,2796,2797,2803],{"type":45,"tag":71,"props":2792,"children":2793},{},[2794],{"type":50,"value":2795},"Retry semantics:",{"type":50,"value":982},{"type":45,"tag":59,"props":2798,"children":2800},{"className":2799},[],[2801],{"type":50,"value":2802},"maxRetries",{"type":50,"value":2804}," is maximum across all executions in bucket, not average",{"type":45,"tag":116,"props":2806,"children":2807},{},[2808,2813,2814,2819],{"type":45,"tag":71,"props":2809,"children":2810},{},[2811],{"type":50,"value":2812},"Fingerprint encoding:",{"type":50,"value":155},{"type":45,"tag":59,"props":2815,"children":2817},{"className":2816},[],[2818],{"type":50,"value":605},{"type":50,"value":2820}," for human-readable IDs",{"type":45,"tag":105,"props":2822,"children":2824},{"id":2823},"references",[2825],{"type":50,"value":2826},"References",{"type":45,"tag":53,"props":2828,"children":2829},{},[2830],{"type":45,"tag":71,"props":2831,"children":2832},{},[2833],{"type":50,"value":2834},"Skill references:",{"type":45,"tag":112,"props":2836,"children":2837},{},[2838,2846,2855,2864],{"type":45,"tag":116,"props":2839,"children":2840},{},[2841],{"type":45,"tag":79,"props":2842,"children":2843},{"href":727},[2844],{"type":50,"value":2845},"JSON field schema and extraction",{"type":45,"tag":116,"props":2847,"children":2848},{},[2849],{"type":45,"tag":79,"props":2850,"children":2852},{"href":2851},"references\u002Fmetrics-and-units.md",[2853],{"type":50,"value":2854},"Metrics catalog and units",{"type":45,"tag":116,"props":2856,"children":2857},{},[2858],{"type":45,"tag":79,"props":2859,"children":2861},{"href":2860},"references\u002Fsql-query-variations.md",[2862],{"type":50,"value":2863},"SQL query variations",{"type":45,"tag":116,"props":2865,"children":2866},{},[2867,2872],{"type":45,"tag":79,"props":2868,"children":2869},{"href":276},[2870],{"type":50,"value":2871},"RBAC and privileges",{"type":50,"value":2873}," (shared with triaging-live-sql-activity)",{"type":45,"tag":53,"props":2875,"children":2876},{},[2877],{"type":45,"tag":71,"props":2878,"children":2879},{},[2880],{"type":50,"value":2881},"Official CockroachDB Documentation:",{"type":45,"tag":112,"props":2883,"children":2884},{},[2885,2896,2906,2916],{"type":45,"tag":116,"props":2886,"children":2887},{},[2888],{"type":45,"tag":79,"props":2889,"children":2893},{"href":2890,"rel":2891},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fcrdb-internal.html",[2892],"nofollow",[2894],{"type":50,"value":2895},"crdb_internal",{"type":45,"tag":116,"props":2897,"children":2898},{},[2899],{"type":45,"tag":79,"props":2900,"children":2903},{"href":2901,"rel":2902},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fui-transactions-page.html",[2892],[2904],{"type":50,"value":2905},"Transactions Page (DB Console)",{"type":45,"tag":116,"props":2907,"children":2908},{},[2909],{"type":45,"tag":79,"props":2910,"children":2913},{"href":2911,"rel":2912},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fmonitor-and-analyze-transaction-contention.html",[2892],[2914],{"type":50,"value":2915},"Monitor and Analyze Transaction Contention",{"type":45,"tag":116,"props":2917,"children":2918},{},[2919],{"type":45,"tag":79,"props":2920,"children":2923},{"href":2921,"rel":2922},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fsecurity-reference\u002Fauthorization.html#supported-privileges",[2892],[2924],{"type":50,"value":2925},"VIEWACTIVITY privilege",{"type":45,"tag":53,"props":2927,"children":2928},{},[2929],{"type":45,"tag":71,"props":2930,"children":2931},{},[2932],{"type":50,"value":2933},"Related skills:",{"type":45,"tag":112,"props":2935,"children":2936},{},[2937,2946],{"type":45,"tag":116,"props":2938,"children":2939},{},[2940,2944],{"type":45,"tag":79,"props":2941,"children":2942},{"href":81},[2943],{"type":50,"value":84},{"type":50,"value":2945}," - For statement-level optimization",{"type":45,"tag":116,"props":2947,"children":2948},{},[2949,2953],{"type":45,"tag":79,"props":2950,"children":2951},{"href":99},[2952],{"type":50,"value":102},{"type":50,"value":2954}," - For immediate triage of active transactions",{"type":45,"tag":2956,"props":2957,"children":2958},"style",{},[2959],{"type":50,"value":2960},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2962,"total":3055},[2963,2975,2989,3006,3019,3032,3045],{"slug":2964,"name":2964,"fn":2965,"description":2966,"org":2967,"tags":2968,"stars":22,"repoUrl":23,"updatedAt":2974},"analyzing-range-distribution","analyze CockroachDB range distribution and health","Analyzes CockroachDB range distribution across tables and indexes using SHOW RANGES to identify range count, size patterns, leaseholder placement, and replication health. Use when investigating hotspots, uneven data distribution, range fragmentation, or validating zone configuration effects without DB Console access.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2969,2970,2973],{"name":17,"slug":18,"type":15},{"name":2971,"slug":2972,"type":15},"Monitoring","monitoring",{"name":13,"slug":14,"type":15},"2026-07-12T07:57:18.753533",{"slug":2976,"name":2976,"fn":2977,"description":2978,"org":2979,"tags":2980,"stars":22,"repoUrl":23,"updatedAt":2988},"analyzing-schema-change-storage-risk","analyze schema change storage requirements","Estimates storage requirements for CockroachDB online schema change backfills using SHOW RANGES WITH DETAILS, KEYS, INDEXES. Use before CREATE INDEX, ADD COLUMN with INDEX\u002FUNIQUE, ALTER PRIMARY KEY, CREATE MATERIALIZED VIEW, CREATE TABLE AS, REFRESH, or SET LOCALITY on tables with large per-index footprints, to avoid mid-backfill disk exhaustion.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2981,2984,2985,2986],{"name":2982,"slug":2983,"type":15},"Data Modeling","data-modeling",{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":2987,"slug":244,"type":15},"SQL","2026-07-12T07:57:22.763788",{"slug":2990,"name":2990,"fn":2991,"description":2992,"org":2993,"tags":2994,"stars":22,"repoUrl":23,"updatedAt":3005},"auditing-cis-benchmark","audit CockroachDB clusters against CIS benchmarks","Audits a self-hosted CockroachDB cluster against the CIS CockroachDB Benchmark v1.0.0 Level 1 controls. Supports two audit depths — quick automated scans and full CIS audit procedures. Produces a structured PASS\u002FFAIL\u002FMANUAL report covering installation, system hardening, logging, user access, data protection, and CockroachDB settings. Use when preparing for CIS compliance assessments, hardening self-hosted deployments, or validating security posture against industry benchmarks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2995,2998,3001,3002],{"name":2996,"slug":2997,"type":15},"Audit","audit",{"name":2999,"slug":3000,"type":15},"Compliance","compliance",{"name":17,"slug":18,"type":15},{"name":3003,"slug":3004,"type":15},"Security","security","2026-07-18T05:48:00.862384",{"slug":3007,"name":3007,"fn":3008,"description":3009,"org":3010,"tags":3011,"stars":22,"repoUrl":23,"updatedAt":3018},"auditing-cloud-cluster-security","audit CockroachDB cluster security posture","Audits the security posture of a CockroachDB cluster (Cloud or self-hosted) across network, authentication, authorization, encryption, audit logging, and backup dimensions. Use when assessing cluster security readiness, preparing for compliance reviews, or investigating security configuration gaps.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3012,3013,3014,3017],{"name":2996,"slug":2997,"type":15},{"name":17,"slug":18,"type":15},{"name":3015,"slug":3016,"type":15},"Operations","operations",{"name":3003,"slug":3004,"type":15},"2026-07-12T07:57:01.506735",{"slug":3020,"name":3020,"fn":3021,"description":3022,"org":3023,"tags":3024,"stars":22,"repoUrl":23,"updatedAt":3031},"auditing-table-statistics","audit optimizer table statistics","Audits optimizer table statistics for staleness, missing coverage, and data quality issues using SHOW STATISTICS. Use when diagnosing poor query performance, unexpected plan changes, or after bulk data changes to identify stale statistics requiring refresh via CREATE STATISTICS.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3025,3026,3029,3030],{"name":2996,"slug":2997,"type":15},{"name":3027,"slug":3028,"type":15},"Data Analysis","data-analysis",{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},"2026-07-12T07:57:16.190081",{"slug":3033,"name":3033,"fn":3034,"description":3035,"org":3036,"tags":3037,"stars":22,"repoUrl":23,"updatedAt":3044},"benchmarking-transaction-patterns","benchmark CockroachDB transaction patterns","Guides benchmarking and comparing explicit multi-statement transactions versus single-statement CTE transactions in CockroachDB, with fair test methodology, contention analysis, and performance interpretation. Use when comparing transaction formulations, benchmarking CockroachDB workloads under contention, investigating retry pressure, or deciding whether to rewrite multi-step application flows into single SQL statements.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3038,3039,3042,3043],{"name":17,"slug":18,"type":15},{"name":3040,"slug":3041,"type":15},"Engineering","engineering",{"name":13,"slug":14,"type":15},{"name":2987,"slug":244,"type":15},"2026-07-12T07:57:26.543278",{"slug":3046,"name":3046,"fn":3047,"description":3048,"org":3049,"tags":3050,"stars":22,"repoUrl":23,"updatedAt":3054},"cockroachdb-sql","write and optimize CockroachDB SQL","Use when writing, generating, or optimizing SQL for CockroachDB, designing CockroachDB schemas, or when the user asks about CockroachDB-specific SQL patterns, type mappings, and distributed database best practices. Also use when encountering CockroachDB anti-patterns like missing primary keys, sequential ID hotspots, or incorrect type usage.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3051,3052,3053],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":2987,"slug":244,"type":15},"2026-07-25T05:31:22.562808",34,{"items":3057,"total":3175},[3058,3075,3089,3102,3113,3123,3134,3140,3147,3154,3161,3168],{"slug":3059,"name":3059,"fn":3060,"description":3061,"org":3062,"tags":3063,"stars":3072,"repoUrl":3073,"updatedAt":3074},"collecting-cockroachdb-operator-escalation-packet","collect CockroachDB operator escalation packets","Collects a complete CockroachDB Operator escalation packet for TSC\u002FTSE or operator-team handoff, including Helm state, Kubernetes resources, logs, operation-specific evidence, pprof goroutine dumps, metrics, and a customer action timeline. Use when general diagnosis cannot resolve an operator-managed CockroachDB Helm issue or before restarting a stuck operator.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3064,3065,3068,3071],{"name":17,"slug":18,"type":15},{"name":3066,"slug":3067,"type":15},"Incident Response","incident-response",{"name":3069,"slug":3070,"type":15},"Kubernetes","kubernetes",{"name":2971,"slug":2972,"type":15},105,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fhelm-charts","2026-07-12T07:57:25.288146",{"slug":3076,"name":3076,"fn":3077,"description":3078,"org":3079,"tags":3080,"stars":3072,"repoUrl":3073,"updatedAt":3088},"configuring-cockroachdb-helm-tls","configure TLS for CockroachDB Helm charts","Selects and validates TLS settings for CockroachDB Helm chart deployments, including self-signer, cert-manager, and external certificate modes. Use when a customer needs secure CockroachDB Helm values, certificate secret mapping, cert-manager integration, or TLS install troubleshooting before deploying the chart.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3081,3084,3087],{"name":3082,"slug":3083,"type":15},"Deployment","deployment",{"name":3085,"slug":3086,"type":15},"Encryption","encryption",{"name":3003,"slug":3004,"type":15},"2026-07-12T07:56:37.675396",{"slug":3090,"name":3090,"fn":3091,"description":3092,"org":3093,"tags":3094,"stars":3072,"repoUrl":3073,"updatedAt":3101},"debugging-cockroachdb-operator-migrations","debug CockroachDB Operator migration scenarios","Debugs CockroachDB Operator migration scenarios, including Helm StatefulSet to v1beta1 CrdbNode migration and public operator v1alpha1 to v1beta1 migration. Use when migration labels, migration phases, source StatefulSet ownership, converted CRDs, PVC ownership, or post-migration reconciliation are unclear or stuck.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3095,3096,3097,3098],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":3069,"slug":3070,"type":15},{"name":3099,"slug":3100,"type":15},"Migration","migration","2026-07-12T07:56:48.360871",{"slug":3103,"name":3103,"fn":3104,"description":3105,"org":3106,"tags":3107,"stars":3072,"repoUrl":3073,"updatedAt":3112},"diagnosing-cockroachdb-helm-deployments","diagnose CockroachDB Helm chart deployments","Diagnoses failed or unhealthy CockroachDB Helm chart deployments by checking Helm release state, operator health, CrdbCluster and CrdbNode status, pod readiness, RBAC, webhooks, TLS, upgrades, scaling, PVCs, DNS, and multi-region assumptions. Use when Helm install or upgrade fails, pods are not Ready, or the operator is not reconciling.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3108,3109,3110,3111],{"name":17,"slug":18,"type":15},{"name":20,"slug":21,"type":15},{"name":3082,"slug":3083,"type":15},{"name":3069,"slug":3070,"type":15},"2026-07-12T07:57:24.018818",{"slug":3114,"name":3114,"fn":3115,"description":3116,"org":3117,"tags":3118,"stars":3072,"repoUrl":3073,"updatedAt":3122},"installing-cockroachdb-with-helm","install CockroachDB using Helm","Guides customer-facing installation of CockroachDB on Kubernetes using the CockroachDB split Helm charts and operator-managed v1beta1 resources. Use when installing CockroachDB with Helm, choosing between published and local split charts, verifying a new install, or helping an agent complete first-time Kubernetes onboarding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3119,3120,3121],{"name":17,"slug":18,"type":15},{"name":3082,"slug":3083,"type":15},{"name":3069,"slug":3070,"type":15},"2026-07-12T07:56:45.777567",{"slug":3124,"name":3124,"fn":3125,"description":3126,"org":3127,"tags":3128,"stars":3072,"repoUrl":3073,"updatedAt":3133},"validating-cockroachdb-helm-multiregion","validate CockroachDB multi-region Helm deployments","Validates CockroachDB Helm chart values and Kubernetes prerequisites for operator-managed multi-region deployments. Use before adding a region, deploying CockroachDB across multiple Kubernetes clusters, checking region DNS domains, or confirming that all regions share certificate and networking assumptions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3129,3130,3131,3132],{"name":17,"slug":18,"type":15},{"name":3082,"slug":3083,"type":15},{"name":3069,"slug":3070,"type":15},{"name":3015,"slug":3016,"type":15},"2026-07-12T07:56:47.082609",{"slug":2964,"name":2964,"fn":2965,"description":2966,"org":3135,"tags":3136,"stars":22,"repoUrl":23,"updatedAt":2974},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3137,3138,3139],{"name":17,"slug":18,"type":15},{"name":2971,"slug":2972,"type":15},{"name":13,"slug":14,"type":15},{"slug":2976,"name":2976,"fn":2977,"description":2978,"org":3141,"tags":3142,"stars":22,"repoUrl":23,"updatedAt":2988},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3143,3144,3145,3146],{"name":2982,"slug":2983,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":2987,"slug":244,"type":15},{"slug":2990,"name":2990,"fn":2991,"description":2992,"org":3148,"tags":3149,"stars":22,"repoUrl":23,"updatedAt":3005},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3150,3151,3152,3153],{"name":2996,"slug":2997,"type":15},{"name":2999,"slug":3000,"type":15},{"name":17,"slug":18,"type":15},{"name":3003,"slug":3004,"type":15},{"slug":3007,"name":3007,"fn":3008,"description":3009,"org":3155,"tags":3156,"stars":22,"repoUrl":23,"updatedAt":3018},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3157,3158,3159,3160],{"name":2996,"slug":2997,"type":15},{"name":17,"slug":18,"type":15},{"name":3015,"slug":3016,"type":15},{"name":3003,"slug":3004,"type":15},{"slug":3020,"name":3020,"fn":3021,"description":3022,"org":3162,"tags":3163,"stars":22,"repoUrl":23,"updatedAt":3031},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3164,3165,3166,3167],{"name":2996,"slug":2997,"type":15},{"name":3027,"slug":3028,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"slug":3033,"name":3033,"fn":3034,"description":3035,"org":3169,"tags":3170,"stars":22,"repoUrl":23,"updatedAt":3044},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3171,3172,3173,3174],{"name":17,"slug":18,"type":15},{"name":3040,"slug":3041,"type":15},{"name":13,"slug":14,"type":15},{"name":2987,"slug":244,"type":15},40]