[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-cockroachdb-analyzing-range-distribution":3,"mdc-poqa1m-key":36,"related-org-cockroachdb-analyzing-range-distribution":2522,"related-repo-cockroachdb-analyzing-range-distribution":2678},{"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},"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},"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},"Monitoring","monitoring",{"name":20,"slug":21,"type":15},"Database","database",3,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin","2026-07-12T07:57:18.753533",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\u002Fanalyzing-range-distribution","---\nname: analyzing-range-distribution\ndescription: 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.\ncompatibility: Requires SQL access with admin role or ZONECONFIG system privilege. DETAILS option has high cost; use targeted queries with LIMIT. Production-safe for basic usage.\nmetadata:\n  author: cockroachdb\n  version: \"1.0\"\n---\n\n# Analyzing Range Distribution\n\nAnalyzes CockroachDB range distribution, leaseholder placement, and zone configuration compliance using `SHOW RANGES` and `SHOW ZONE CONFIGURATIONS` commands. Identifies range count anomalies, size imbalances, leaseholder hotspots, and replication issues - entirely via SQL without requiring DB Console access.\n\n**Complement to profiling skills:** This skill analyzes range-level data distribution; for query performance patterns, see [profiling-statement-fingerprints](..\u002Fprofiling-statement-fingerprints\u002FSKILL.md). For schema change storage planning, see [analyzing-schema-change-storage-risk](..\u002Fanalyzing-schema-change-storage-risk\u002FSKILL.md).\n\n## When to Use This Skill\n\n- Identify tables\u002Findexes with excessive range counts indicating fragmentation\n- Detect range size imbalances or uneven data distribution across nodes\n- Investigate leaseholder concentration causing read hotspots\n- Validate zone configuration effects on range placement and replica distribution\n- Diagnose range-level replication issues (under-replicated or unavailable ranges)\n- Analyze range split patterns from high write volume\n- SQL-only range analysis without DB Console access\n\n**For schema change planning:** Use [analyzing-schema-change-storage-risk](..\u002Fanalyzing-schema-change-storage-risk\u002FSKILL.md) to estimate storage requirements before CREATE INDEX or ADD COLUMN operations.\n\n## Prerequisites\n\n- SQL connection to CockroachDB cluster\n- Admin role OR `ZONECONFIG` system privilege\n- Understanding of CockroachDB range architecture (default 512MB max size; verify with `SHOW ZONE CONFIGURATION FOR RANGE default`)\n- Knowledge of cluster topology (node IDs, regions, availability zones)\n\n**Check your privileges:**\n```sql\nSHOW SYSTEM GRANTS FOR \u003Cusername>;  -- Should show admin or ZONECONFIG\n```\n\nSee [permissions reference](references\u002Fpermissions.md) for RBAC setup.\n\n## Core Concepts\n\n### Ranges: Units of Data Distribution\n\n**Range:** Contiguous key space segment (default 512MB max size, configurable via zone config `range_max_bytes`)\n**Raft group:** Each range replicated across nodes (default 3 replicas)\n**Leaseholder:** Single replica handling reads and coordinating writes for a range\n\n**Critical:** Ranges split automatically at `range_max_bytes` (default 512MB), but can fragment further due to load-based splitting during high write traffic.\n\n### Leaseholders and Hotspots\n\n**Leaseholder concentration:** Single node holding disproportionate leaseholders = read hotspot\n**Load-based splitting:** CockroachDB splits ranges experiencing high QPS, increasing range count\n**Hotspot symptoms:** High CPU on single node, slow reads on specific table\u002Findex\n\n### Range Fragmentation\n\n**Fragmentation:** Excessive range splits creating many small ranges (overhead from Raft coordination)\n**Causes:** High write throughput, sequential inserts (timestamp-based primary keys), load-based splitting\n**Symptoms:** High range count relative to data size, increased latency from Raft overhead\n\n**Fragmentation metric:** Ranges per GB. With the 512MB default `range_max_bytes`, a fully-grown range covers 0.5 GB — so ~2 ranges\u002FGB is the natural floor. Anything well above that (e.g., 10+ ranges\u002FGB) suggests load-based splits or many small ranges; tune to your workload.\n\n### Zone Configurations\n\n**Zone config:** Replication and placement policies for databases, tables, or indexes\n**Replication factor:** Number of replicas per range (default: 3)\n**Constraints:** Node placement rules (region, availability zone, node attributes)\n\n**Use case:** Validate intended zone config matches actual range placement.\n\n### SHOW RANGES DETAILS Option\n\n**CRITICAL SAFETY WARNING:** The `WITH DETAILS` option computes `span_stats` (range size, key counts) on-demand, causing:\n- **High CPU usage** from statistics computation\n- **Memory overhead** proportional to range count\n- **Query timeouts** on large tables without LIMIT\n\n**Best practice:** Always use `LIMIT` with `DETAILS`, target specific tables\u002Findexes, avoid cluster-wide scans.\n\n## Core Diagnostic Queries\n\n### Query 1: Range Count by Table (Production-Safe)\n\n```sql\nSELECT\n  table_name,\n  index_name,\n  COUNT(*) AS range_count\nFROM [SHOW RANGES FROM TABLE your_table_name]\nGROUP BY table_name, index_name\nORDER BY range_count DESC;\n```\n\n**Interpretation:** High range count (1000s) on small tables indicates fragmentation. Cross-reference with table size.\n\n**Safety:** No `DETAILS` option = production-safe, minimal overhead.\n\n### Query 2: Range Size Analysis (Targeted DETAILS)\n\n```sql\nSELECT\n  range_id,\n  start_key,\n  end_key,\n  (span_stats->>'approximate_disk_bytes')::INT \u002F 1048576 AS size_mb,\n  lease_holder,\n  replicas\nFROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]\nORDER BY (span_stats->>'approximate_disk_bytes')::INT DESC\nLIMIT 50;\n```\n\n**Interpretation:** Ranges close to or above `range_max_bytes` (default 512MB) indicate split lag; many small ranges (\u003C10MB) indicate fragmentation.\n\n**CRITICAL:** Always include `LIMIT` and target specific tables. Never run `SHOW RANGES WITH DETAILS` on entire database.\n\n### Query 3: Leaseholder Distribution (Hotspot Detection)\n\n```sql\nSELECT\n  lease_holder,\n  COUNT(*) AS leaseholder_count,\n  ROUND(COUNT(*) * 100.0 \u002F SUM(COUNT(*)) OVER (), 2) AS percentage\nFROM [SHOW RANGES FROM TABLE your_table_name]\nGROUP BY lease_holder\nORDER BY leaseholder_count DESC;\n```\n\n**Interpretation:** >40% leaseholders on single node in balanced cluster = hotspot. Check if table has zone constraints favoring specific nodes.\n\n**Remediation:** Use `ALTER TABLE ... CONFIGURE ZONE USING lease_preferences` to spread leaseholders.\n\n### Query 4: Range Replication Health Check\n\n```sql\nSELECT\n  range_id,\n  start_key,\n  replicas,\n  array_length(replicas, 1) AS replica_count,\n  voting_replicas,\n  array_length(voting_replicas, 1) AS voting_replica_count,\n  lease_holder\nFROM [SHOW RANGES FROM TABLE your_table_name]\nWHERE array_length(replicas, 1) \u003C 3  -- Under-replicated\nORDER BY range_id\nLIMIT 100;\n```\n\n**Interpretation:** `replica_count \u003C 3` = under-replicated (data loss risk). Check for node failures, decommissioning operations, or zone config mismatches.\n\n**Safety:** No `DETAILS` = production-safe.\n\n### Query 5: Zone Configuration Audit\n\n```sql\nSHOW ZONE CONFIGURATIONS;\n```\n\n**Output columns:**\n- `target`: Database, table, or index\n- `raw_config_sql`: Zone config SQL (replication factor, constraints)\n\n**Use case:** Validate intended replication factor and placement constraints match expected design.\n\n**Cross-reference:** Compare zone configs with Query 3 (leaseholder distribution) and Query 4 (replica health) to validate actual placement.\n\n### Query 6: Fragmentation Analysis (Ranges per GB)\n\n```sql\nWITH range_counts AS (\n  SELECT\n    table_name,\n    index_name,\n    COUNT(*) AS range_count\n  FROM [SHOW RANGES FROM TABLE your_table_name]\n  GROUP BY table_name, index_name\n),\ntable_sizes AS (\n  SELECT\n    table_name,\n    SUM((span_stats->>'approximate_disk_bytes')::INT) \u002F 1073741824.0 AS size_gb\n  FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]\n  GROUP BY table_name\n)\nSELECT\n  rc.table_name,\n  rc.index_name,\n  rc.range_count,\n  ts.size_gb,\n  ROUND(rc.range_count \u002F NULLIF(ts.size_gb, 0), 2) AS ranges_per_gb\nFROM range_counts rc\nJOIN table_sizes ts ON rc.table_name = ts.table_name\nORDER BY ranges_per_gb DESC;\n```\n\n**Interpretation:**\n- **Healthy:** 1-15 ranges\u002FGB\n- **Moderate fragmentation:** 16-50 ranges\u002FGB\n- **Severe fragmentation:** 50+ ranges\u002FGB\n\n**CRITICAL:** This query uses `DETAILS` - only run on targeted tables with known size, never cluster-wide.\n\n**Remediation:** Increase `range_max_bytes` via zone config (with caution), or accept fragmentation if caused by necessary load-based splitting.\n\nSee [sql-queries reference](references\u002Fsql-queries.md) for complete query variations and guardrails.\n\n## Common Workflows\n\n### Workflow 1: Hotspot Investigation\n\n**Scenario:** Single node experiencing high CPU, slow reads on specific table.\n\n**Steps:**\n1. **Identify leaseholder concentration:** Run Query 3 on suspected table\n2. **Validate zone config:** Run Query 5 to check lease_preferences\n3. **Check for load-based splits:** Run Query 1 to detect recent range fragmentation (symptom of hotspot)\n4. **Remediate:** Configure lease preferences to spread reads, or partition table if hotspot is on sequential key range\n\n**Example:**\n```sql\n-- Check leaseholder distribution\nSELECT lease_holder, COUNT(*) FROM [SHOW RANGES FROM TABLE hot_table] GROUP BY lease_holder;\n\n-- Validate zone config\nSHOW ZONE CONFIGURATION FOR TABLE hot_table;\n\n-- Spread leaseholders if concentrated\nALTER TABLE hot_table CONFIGURE ZONE USING lease_preferences = '[[+region=us-west]]';\n```\n\n### Workflow 2: Zone Config Validation\n\n**Scenario:** After configuring multi-region setup, validate ranges are placed according to constraints.\n\n**Steps:**\n1. **Review intended configs:** Run Query 5 (SHOW ZONE CONFIGURATIONS)\n2. **Check actual replica placement:** Run Query 4 on critical tables, inspect `replicas` array for node IDs\n3. **Map node IDs to regions:** Use `SHOW REGIONS` (cluster-wide) or read the `locality` column of `cockroach node status`\n4. **Identify mismatches:** Ranges not matching constraints indicate rebalancing in progress or misconfiguration\n\n**Example:**\n```sql\n-- Show zone config\nSHOW ZONE CONFIGURATION FOR TABLE multi_region_table;\n\n-- Check replica placement\nSELECT range_id, replicas FROM [SHOW RANGES FROM TABLE multi_region_table] LIMIT 20;\n\n-- Map node IDs to regions (cluster-level view)\nSHOW REGIONS;\n-- For per-node locality strings, use the CLI:\n--   cockroach node status --certs-dir=\u003Ccerts-dir> --host=\u003Cany-live-node>\n```\n\n### Workflow 3: Fragmentation Diagnosis\n\n**Scenario:** Table with high range count relative to size, experiencing latency.\n\n**Steps:**\n1. **Calculate ranges per GB:** Run Query 6 (targeted to specific table)\n2. **Check for load-based splits:** Review write patterns (sequential inserts, high QPS periods)\n3. **Determine if expected:** Fragmentation may be intentional for load distribution\n4. **Remediate if excessive:** Increase `range_max_bytes` (with caution - larger ranges = slower splits), or investigate reducing write hotspots\n\n**CRITICAL:** `range_max_bytes` defaults to 512MB. Raising it further without understanding the impact on split\u002Frebalance performance is risky.\n\n## Safety Considerations\n\n### DETAILS Option Cost\n\n**Resource impact:**\n- **CPU:** Computes span statistics on-demand for each range\n- **Memory:** Proportional to range count returned\n- **Timeout risk:** High on tables with 1000s of ranges without LIMIT\n\n**Mitigation strategies:**\n1. **Always use LIMIT:** Cap at 50-100 ranges for exploratory analysis\n2. **Target specific tables:** Use `FROM TABLE table_name`, never cluster-wide `SHOW RANGES WITH DETAILS`\n3. **Use basic queries first:** Run Query 1 (no DETAILS) to assess range count before using DETAILS\n4. **Production timing:** Run during maintenance windows or low-traffic periods\n\n### Privilege Safety\n\n**Admin role:** Full cluster access, use with caution in production\n**ZONECONFIG privilege:** Limited to viewing ranges and zone configs, safer for read-only analysis\n\n**Best practice:** Grant `ZONECONFIG` instead of admin for range analysis operators.\n\nSee [permissions reference](references\u002Fpermissions.md) for granting minimal privileges.\n\n### Production Impact\n\n**Read-only operations:** All queries are `SELECT` or `SHOW` statements with no writes.\n\n**Performance considerations:**\n\n| Query Type | Impact | Safe for Production? |\n|------------|--------|---------------------|\n| Basic SHOW RANGES | Minimal CPU, metadata-only | Yes |\n| SHOW RANGES WITH DETAILS (targeted, LIMIT 50) | Moderate CPU spike | Yes (low-traffic window) |\n| SHOW RANGES WITH DETAILS (no LIMIT) | High CPU, timeout risk | **NO - NEVER USE** |\n| SHOW ZONE CONFIGURATIONS | Minimal, metadata-only | Yes |\n\n## Troubleshooting\n\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| Permission denied | Missing admin or ZONECONFIG privilege | Grant ZONECONFIG: `GRANT SYSTEM ZONECONFIG TO user` |\n| Query timeout with DETAILS | Too many ranges without LIMIT | Add `LIMIT 50`, target specific table |\n| Empty span_stats column | Missing DETAILS keyword | Add `WITH DETAILS` to SHOW RANGES |\n| Unexpected high range count | Load-based splitting or fragmentation | Run Query 6 to calculate ranges\u002FGB, review write patterns |\n| Leaseholder = 0 or NULL | Range in transition during rebalancing | Normal during cluster changes, retry query |\n| Under-replicated ranges | Node failure, decommission, zone mismatch | Check node status, validate zone config constraints |\n| SHOW ZONE CONFIGURATIONS shows no custom configs | Using default cluster-wide config | Normal if no table\u002Fdatabase-level overrides set |\n\n## Key Considerations\n\n- **DETAILS option:** Expensive operation - always use with LIMIT and targeted scope\n- **Fragmentation is sometimes intentional:** Load-based splitting improves concurrency\n- **Leaseholder concentration:** Check zone configs (lease_preferences) before assuming hotspot\n- **Range size target:** Default `range_max_bytes` is 512MB (verify with `SHOW ZONE CONFIGURATION FOR RANGE default`)\n- **Replication lag:** Range placement may not immediately reflect zone config changes (rebalancing takes time)\n- **Cross-reference queries:** Combine range analysis with zone configs for complete picture\n- **Node mapping:** Use `SHOW REGIONS` for cluster-level locality, or `cockroach node status` for per-node locality\n\n## References\n\n**Skill references:**\n- [SQL query variations and guardrails](references\u002Fsql-queries.md)\n- [RBAC and privileges setup](references\u002Fpermissions.md)\n\n**Official CockroachDB Documentation:**\n- [SHOW RANGES](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-ranges.html)\n- [SHOW ZONE CONFIGURATIONS](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-zone-configurations.html)\n- [Architecture: Distribution Layer](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Farchitecture\u002Fdistribution-layer.html)\n- [Configure Replication Zones](https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fconfigure-replication-zones.html)\n- [ZONECONFIG 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 query performance analysis\n- [triaging-live-sql-activity](..\u002Ftriaging-live-sql-activity\u002FSKILL.md) - For real-time query triage\n- [analyzing-schema-change-storage-risk](..\u002Fanalyzing-schema-change-storage-risk\u002FSKILL.md) - For estimating storage requirements before DDL operations\n",{"data":37,"body":41},{"name":4,"description":6,"compatibility":38,"metadata":39},"Requires SQL access with admin role or ZONECONFIG system privilege. DETAILS option has high cost; use targeted queries with LIMIT. Production-safe for basic usage.",{"author":8,"version":40},"1.0",{"type":42,"children":43},"root",[44,52,75,103,110,150,166,172,211,219,240,253,259,266,298,315,321,345,351,375,392,398,422,432,438,464,497,523,529,535,602,612,629,635,724,740,765,771,831,840,857,863,964,981,996,1002,1016,1024,1049,1058,1068,1074,1281,1288,1321,1337,1353,1365,1371,1377,1387,1395,1439,1447,1518,1524,1533,1540,1612,1619,1704,1710,1719,1726,1774,1789,1795,1801,1809,1842,1850,1905,1911,1928,1944,1954,1960,1986,1994,2100,2106,2279,2285,2383,2389,2397,2416,2424,2476,2484,2516],{"type":45,"tag":46,"props":47,"children":48},"element","h1",{"id":4},[49],{"type":50,"value":51},"text","Analyzing Range Distribution",{"type":45,"tag":53,"props":54,"children":55},"p",{},[56,58,65,67,73],{"type":50,"value":57},"Analyzes CockroachDB range distribution, leaseholder placement, and zone configuration compliance using ",{"type":45,"tag":59,"props":60,"children":62},"code",{"className":61},[],[63],{"type":50,"value":64},"SHOW RANGES",{"type":50,"value":66}," and ",{"type":45,"tag":59,"props":68,"children":70},{"className":69},[],[71],{"type":50,"value":72},"SHOW ZONE CONFIGURATIONS",{"type":50,"value":74}," commands. Identifies range count anomalies, size imbalances, leaseholder hotspots, and replication issues - entirely via SQL without requiring DB Console access.",{"type":45,"tag":53,"props":76,"children":77},{},[78,84,86,93,95,101],{"type":45,"tag":79,"props":80,"children":81},"strong",{},[82],{"type":50,"value":83},"Complement to profiling skills:",{"type":50,"value":85}," This skill analyzes range-level data distribution; for query performance patterns, see ",{"type":45,"tag":87,"props":88,"children":90},"a",{"href":89},"..\u002Fprofiling-statement-fingerprints\u002FSKILL.md",[91],{"type":50,"value":92},"profiling-statement-fingerprints",{"type":50,"value":94},". For schema change storage planning, see ",{"type":45,"tag":87,"props":96,"children":98},{"href":97},"..\u002Fanalyzing-schema-change-storage-risk\u002FSKILL.md",[99],{"type":50,"value":100},"analyzing-schema-change-storage-risk",{"type":50,"value":102},".",{"type":45,"tag":104,"props":105,"children":107},"h2",{"id":106},"when-to-use-this-skill",[108],{"type":50,"value":109},"When to Use This Skill",{"type":45,"tag":111,"props":112,"children":113},"ul",{},[114,120,125,130,135,140,145],{"type":45,"tag":115,"props":116,"children":117},"li",{},[118],{"type":50,"value":119},"Identify tables\u002Findexes with excessive range counts indicating fragmentation",{"type":45,"tag":115,"props":121,"children":122},{},[123],{"type":50,"value":124},"Detect range size imbalances or uneven data distribution across nodes",{"type":45,"tag":115,"props":126,"children":127},{},[128],{"type":50,"value":129},"Investigate leaseholder concentration causing read hotspots",{"type":45,"tag":115,"props":131,"children":132},{},[133],{"type":50,"value":134},"Validate zone configuration effects on range placement and replica distribution",{"type":45,"tag":115,"props":136,"children":137},{},[138],{"type":50,"value":139},"Diagnose range-level replication issues (under-replicated or unavailable ranges)",{"type":45,"tag":115,"props":141,"children":142},{},[143],{"type":50,"value":144},"Analyze range split patterns from high write volume",{"type":45,"tag":115,"props":146,"children":147},{},[148],{"type":50,"value":149},"SQL-only range analysis without DB Console access",{"type":45,"tag":53,"props":151,"children":152},{},[153,158,160,164],{"type":45,"tag":79,"props":154,"children":155},{},[156],{"type":50,"value":157},"For schema change planning:",{"type":50,"value":159}," Use ",{"type":45,"tag":87,"props":161,"children":162},{"href":97},[163],{"type":50,"value":100},{"type":50,"value":165}," to estimate storage requirements before CREATE INDEX or ADD COLUMN operations.",{"type":45,"tag":104,"props":167,"children":169},{"id":168},"prerequisites",[170],{"type":50,"value":171},"Prerequisites",{"type":45,"tag":111,"props":173,"children":174},{},[175,180,193,206],{"type":45,"tag":115,"props":176,"children":177},{},[178],{"type":50,"value":179},"SQL connection to CockroachDB cluster",{"type":45,"tag":115,"props":181,"children":182},{},[183,185,191],{"type":50,"value":184},"Admin role OR ",{"type":45,"tag":59,"props":186,"children":188},{"className":187},[],[189],{"type":50,"value":190},"ZONECONFIG",{"type":50,"value":192}," system privilege",{"type":45,"tag":115,"props":194,"children":195},{},[196,198,204],{"type":50,"value":197},"Understanding of CockroachDB range architecture (default 512MB max size; verify with ",{"type":45,"tag":59,"props":199,"children":201},{"className":200},[],[202],{"type":50,"value":203},"SHOW ZONE CONFIGURATION FOR RANGE default",{"type":50,"value":205},")",{"type":45,"tag":115,"props":207,"children":208},{},[209],{"type":50,"value":210},"Knowledge of cluster topology (node IDs, regions, availability zones)",{"type":45,"tag":53,"props":212,"children":213},{},[214],{"type":45,"tag":79,"props":215,"children":216},{},[217],{"type":50,"value":218},"Check your privileges:",{"type":45,"tag":220,"props":221,"children":226},"pre",{"className":222,"code":223,"language":224,"meta":225,"style":225},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","SHOW SYSTEM GRANTS FOR \u003Cusername>;  -- Should show admin or ZONECONFIG\n","sql","",[227],{"type":45,"tag":59,"props":228,"children":229},{"__ignoreMap":225},[230],{"type":45,"tag":231,"props":232,"children":235},"span",{"class":233,"line":234},"line",1,[236],{"type":45,"tag":231,"props":237,"children":238},{},[239],{"type":50,"value":223},{"type":45,"tag":53,"props":241,"children":242},{},[243,245,251],{"type":50,"value":244},"See ",{"type":45,"tag":87,"props":246,"children":248},{"href":247},"references\u002Fpermissions.md",[249],{"type":50,"value":250},"permissions reference",{"type":50,"value":252}," for RBAC setup.",{"type":45,"tag":104,"props":254,"children":256},{"id":255},"core-concepts",[257],{"type":50,"value":258},"Core Concepts",{"type":45,"tag":260,"props":261,"children":263},"h3",{"id":262},"ranges-units-of-data-distribution",[264],{"type":50,"value":265},"Ranges: Units of Data Distribution",{"type":45,"tag":53,"props":267,"children":268},{},[269,274,276,282,284,289,291,296],{"type":45,"tag":79,"props":270,"children":271},{},[272],{"type":50,"value":273},"Range:",{"type":50,"value":275}," Contiguous key space segment (default 512MB max size, configurable via zone config ",{"type":45,"tag":59,"props":277,"children":279},{"className":278},[],[280],{"type":50,"value":281},"range_max_bytes",{"type":50,"value":283},")\n",{"type":45,"tag":79,"props":285,"children":286},{},[287],{"type":50,"value":288},"Raft group:",{"type":50,"value":290}," Each range replicated across nodes (default 3 replicas)\n",{"type":45,"tag":79,"props":292,"children":293},{},[294],{"type":50,"value":295},"Leaseholder:",{"type":50,"value":297}," Single replica handling reads and coordinating writes for a range",{"type":45,"tag":53,"props":299,"children":300},{},[301,306,308,313],{"type":45,"tag":79,"props":302,"children":303},{},[304],{"type":50,"value":305},"Critical:",{"type":50,"value":307}," Ranges split automatically at ",{"type":45,"tag":59,"props":309,"children":311},{"className":310},[],[312],{"type":50,"value":281},{"type":50,"value":314}," (default 512MB), but can fragment further due to load-based splitting during high write traffic.",{"type":45,"tag":260,"props":316,"children":318},{"id":317},"leaseholders-and-hotspots",[319],{"type":50,"value":320},"Leaseholders and Hotspots",{"type":45,"tag":53,"props":322,"children":323},{},[324,329,331,336,338,343],{"type":45,"tag":79,"props":325,"children":326},{},[327],{"type":50,"value":328},"Leaseholder concentration:",{"type":50,"value":330}," Single node holding disproportionate leaseholders = read hotspot\n",{"type":45,"tag":79,"props":332,"children":333},{},[334],{"type":50,"value":335},"Load-based splitting:",{"type":50,"value":337}," CockroachDB splits ranges experiencing high QPS, increasing range count\n",{"type":45,"tag":79,"props":339,"children":340},{},[341],{"type":50,"value":342},"Hotspot symptoms:",{"type":50,"value":344}," High CPU on single node, slow reads on specific table\u002Findex",{"type":45,"tag":260,"props":346,"children":348},{"id":347},"range-fragmentation",[349],{"type":50,"value":350},"Range Fragmentation",{"type":45,"tag":53,"props":352,"children":353},{},[354,359,361,366,368,373],{"type":45,"tag":79,"props":355,"children":356},{},[357],{"type":50,"value":358},"Fragmentation:",{"type":50,"value":360}," Excessive range splits creating many small ranges (overhead from Raft coordination)\n",{"type":45,"tag":79,"props":362,"children":363},{},[364],{"type":50,"value":365},"Causes:",{"type":50,"value":367}," High write throughput, sequential inserts (timestamp-based primary keys), load-based splitting\n",{"type":45,"tag":79,"props":369,"children":370},{},[371],{"type":50,"value":372},"Symptoms:",{"type":50,"value":374}," High range count relative to data size, increased latency from Raft overhead",{"type":45,"tag":53,"props":376,"children":377},{},[378,383,385,390],{"type":45,"tag":79,"props":379,"children":380},{},[381],{"type":50,"value":382},"Fragmentation metric:",{"type":50,"value":384}," Ranges per GB. With the 512MB default ",{"type":45,"tag":59,"props":386,"children":388},{"className":387},[],[389],{"type":50,"value":281},{"type":50,"value":391},", a fully-grown range covers 0.5 GB — so ~2 ranges\u002FGB is the natural floor. Anything well above that (e.g., 10+ ranges\u002FGB) suggests load-based splits or many small ranges; tune to your workload.",{"type":45,"tag":260,"props":393,"children":395},{"id":394},"zone-configurations",[396],{"type":50,"value":397},"Zone Configurations",{"type":45,"tag":53,"props":399,"children":400},{},[401,406,408,413,415,420],{"type":45,"tag":79,"props":402,"children":403},{},[404],{"type":50,"value":405},"Zone config:",{"type":50,"value":407}," Replication and placement policies for databases, tables, or indexes\n",{"type":45,"tag":79,"props":409,"children":410},{},[411],{"type":50,"value":412},"Replication factor:",{"type":50,"value":414}," Number of replicas per range (default: 3)\n",{"type":45,"tag":79,"props":416,"children":417},{},[418],{"type":50,"value":419},"Constraints:",{"type":50,"value":421}," Node placement rules (region, availability zone, node attributes)",{"type":45,"tag":53,"props":423,"children":424},{},[425,430],{"type":45,"tag":79,"props":426,"children":427},{},[428],{"type":50,"value":429},"Use case:",{"type":50,"value":431}," Validate intended zone config matches actual range placement.",{"type":45,"tag":260,"props":433,"children":435},{"id":434},"show-ranges-details-option",[436],{"type":50,"value":437},"SHOW RANGES DETAILS Option",{"type":45,"tag":53,"props":439,"children":440},{},[441,446,448,454,456,462],{"type":45,"tag":79,"props":442,"children":443},{},[444],{"type":50,"value":445},"CRITICAL SAFETY WARNING:",{"type":50,"value":447}," The ",{"type":45,"tag":59,"props":449,"children":451},{"className":450},[],[452],{"type":50,"value":453},"WITH DETAILS",{"type":50,"value":455}," option computes ",{"type":45,"tag":59,"props":457,"children":459},{"className":458},[],[460],{"type":50,"value":461},"span_stats",{"type":50,"value":463}," (range size, key counts) on-demand, causing:",{"type":45,"tag":111,"props":465,"children":466},{},[467,477,487],{"type":45,"tag":115,"props":468,"children":469},{},[470,475],{"type":45,"tag":79,"props":471,"children":472},{},[473],{"type":50,"value":474},"High CPU usage",{"type":50,"value":476}," from statistics computation",{"type":45,"tag":115,"props":478,"children":479},{},[480,485],{"type":45,"tag":79,"props":481,"children":482},{},[483],{"type":50,"value":484},"Memory overhead",{"type":50,"value":486}," proportional to range count",{"type":45,"tag":115,"props":488,"children":489},{},[490,495],{"type":45,"tag":79,"props":491,"children":492},{},[493],{"type":50,"value":494},"Query timeouts",{"type":50,"value":496}," on large tables without LIMIT",{"type":45,"tag":53,"props":498,"children":499},{},[500,505,507,513,515,521],{"type":45,"tag":79,"props":501,"children":502},{},[503],{"type":50,"value":504},"Best practice:",{"type":50,"value":506}," Always use ",{"type":45,"tag":59,"props":508,"children":510},{"className":509},[],[511],{"type":50,"value":512},"LIMIT",{"type":50,"value":514}," with ",{"type":45,"tag":59,"props":516,"children":518},{"className":517},[],[519],{"type":50,"value":520},"DETAILS",{"type":50,"value":522},", target specific tables\u002Findexes, avoid cluster-wide scans.",{"type":45,"tag":104,"props":524,"children":526},{"id":525},"core-diagnostic-queries",[527],{"type":50,"value":528},"Core Diagnostic Queries",{"type":45,"tag":260,"props":530,"children":532},{"id":531},"query-1-range-count-by-table-production-safe",[533],{"type":50,"value":534},"Query 1: Range Count by Table (Production-Safe)",{"type":45,"tag":220,"props":536,"children":538},{"className":222,"code":537,"language":224,"meta":225,"style":225},"SELECT\n  table_name,\n  index_name,\n  COUNT(*) AS range_count\nFROM [SHOW RANGES FROM TABLE your_table_name]\nGROUP BY table_name, index_name\nORDER BY range_count DESC;\n",[539],{"type":45,"tag":59,"props":540,"children":541},{"__ignoreMap":225},[542,550,558,566,575,584,593],{"type":45,"tag":231,"props":543,"children":544},{"class":233,"line":234},[545],{"type":45,"tag":231,"props":546,"children":547},{},[548],{"type":50,"value":549},"SELECT\n",{"type":45,"tag":231,"props":551,"children":552},{"class":233,"line":26},[553],{"type":45,"tag":231,"props":554,"children":555},{},[556],{"type":50,"value":557},"  table_name,\n",{"type":45,"tag":231,"props":559,"children":560},{"class":233,"line":22},[561],{"type":45,"tag":231,"props":562,"children":563},{},[564],{"type":50,"value":565},"  index_name,\n",{"type":45,"tag":231,"props":567,"children":569},{"class":233,"line":568},4,[570],{"type":45,"tag":231,"props":571,"children":572},{},[573],{"type":50,"value":574},"  COUNT(*) AS range_count\n",{"type":45,"tag":231,"props":576,"children":578},{"class":233,"line":577},5,[579],{"type":45,"tag":231,"props":580,"children":581},{},[582],{"type":50,"value":583},"FROM [SHOW RANGES FROM TABLE your_table_name]\n",{"type":45,"tag":231,"props":585,"children":587},{"class":233,"line":586},6,[588],{"type":45,"tag":231,"props":589,"children":590},{},[591],{"type":50,"value":592},"GROUP BY table_name, index_name\n",{"type":45,"tag":231,"props":594,"children":596},{"class":233,"line":595},7,[597],{"type":45,"tag":231,"props":598,"children":599},{},[600],{"type":50,"value":601},"ORDER BY range_count DESC;\n",{"type":45,"tag":53,"props":603,"children":604},{},[605,610],{"type":45,"tag":79,"props":606,"children":607},{},[608],{"type":50,"value":609},"Interpretation:",{"type":50,"value":611}," High range count (1000s) on small tables indicates fragmentation. Cross-reference with table size.",{"type":45,"tag":53,"props":613,"children":614},{},[615,620,622,627],{"type":45,"tag":79,"props":616,"children":617},{},[618],{"type":50,"value":619},"Safety:",{"type":50,"value":621}," No ",{"type":45,"tag":59,"props":623,"children":625},{"className":624},[],[626],{"type":50,"value":520},{"type":50,"value":628}," option = production-safe, minimal overhead.",{"type":45,"tag":260,"props":630,"children":632},{"id":631},"query-2-range-size-analysis-targeted-details",[633],{"type":50,"value":634},"Query 2: Range Size Analysis (Targeted DETAILS)",{"type":45,"tag":220,"props":636,"children":638},{"className":222,"code":637,"language":224,"meta":225,"style":225},"SELECT\n  range_id,\n  start_key,\n  end_key,\n  (span_stats->>'approximate_disk_bytes')::INT \u002F 1048576 AS size_mb,\n  lease_holder,\n  replicas\nFROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]\nORDER BY (span_stats->>'approximate_disk_bytes')::INT DESC\nLIMIT 50;\n",[639],{"type":45,"tag":59,"props":640,"children":641},{"__ignoreMap":225},[642,649,657,665,673,681,689,697,706,715],{"type":45,"tag":231,"props":643,"children":644},{"class":233,"line":234},[645],{"type":45,"tag":231,"props":646,"children":647},{},[648],{"type":50,"value":549},{"type":45,"tag":231,"props":650,"children":651},{"class":233,"line":26},[652],{"type":45,"tag":231,"props":653,"children":654},{},[655],{"type":50,"value":656},"  range_id,\n",{"type":45,"tag":231,"props":658,"children":659},{"class":233,"line":22},[660],{"type":45,"tag":231,"props":661,"children":662},{},[663],{"type":50,"value":664},"  start_key,\n",{"type":45,"tag":231,"props":666,"children":667},{"class":233,"line":568},[668],{"type":45,"tag":231,"props":669,"children":670},{},[671],{"type":50,"value":672},"  end_key,\n",{"type":45,"tag":231,"props":674,"children":675},{"class":233,"line":577},[676],{"type":45,"tag":231,"props":677,"children":678},{},[679],{"type":50,"value":680},"  (span_stats->>'approximate_disk_bytes')::INT \u002F 1048576 AS size_mb,\n",{"type":45,"tag":231,"props":682,"children":683},{"class":233,"line":586},[684],{"type":45,"tag":231,"props":685,"children":686},{},[687],{"type":50,"value":688},"  lease_holder,\n",{"type":45,"tag":231,"props":690,"children":691},{"class":233,"line":595},[692],{"type":45,"tag":231,"props":693,"children":694},{},[695],{"type":50,"value":696},"  replicas\n",{"type":45,"tag":231,"props":698,"children":700},{"class":233,"line":699},8,[701],{"type":45,"tag":231,"props":702,"children":703},{},[704],{"type":50,"value":705},"FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]\n",{"type":45,"tag":231,"props":707,"children":709},{"class":233,"line":708},9,[710],{"type":45,"tag":231,"props":711,"children":712},{},[713],{"type":50,"value":714},"ORDER BY (span_stats->>'approximate_disk_bytes')::INT DESC\n",{"type":45,"tag":231,"props":716,"children":718},{"class":233,"line":717},10,[719],{"type":45,"tag":231,"props":720,"children":721},{},[722],{"type":50,"value":723},"LIMIT 50;\n",{"type":45,"tag":53,"props":725,"children":726},{},[727,731,733,738],{"type":45,"tag":79,"props":728,"children":729},{},[730],{"type":50,"value":609},{"type":50,"value":732}," Ranges close to or above ",{"type":45,"tag":59,"props":734,"children":736},{"className":735},[],[737],{"type":50,"value":281},{"type":50,"value":739}," (default 512MB) indicate split lag; many small ranges (\u003C10MB) indicate fragmentation.",{"type":45,"tag":53,"props":741,"children":742},{},[743,748,750,755,757,763],{"type":45,"tag":79,"props":744,"children":745},{},[746],{"type":50,"value":747},"CRITICAL:",{"type":50,"value":749}," Always include ",{"type":45,"tag":59,"props":751,"children":753},{"className":752},[],[754],{"type":50,"value":512},{"type":50,"value":756}," and target specific tables. Never run ",{"type":45,"tag":59,"props":758,"children":760},{"className":759},[],[761],{"type":50,"value":762},"SHOW RANGES WITH DETAILS",{"type":50,"value":764}," on entire database.",{"type":45,"tag":260,"props":766,"children":768},{"id":767},"query-3-leaseholder-distribution-hotspot-detection",[769],{"type":50,"value":770},"Query 3: Leaseholder Distribution (Hotspot Detection)",{"type":45,"tag":220,"props":772,"children":774},{"className":222,"code":773,"language":224,"meta":225,"style":225},"SELECT\n  lease_holder,\n  COUNT(*) AS leaseholder_count,\n  ROUND(COUNT(*) * 100.0 \u002F SUM(COUNT(*)) OVER (), 2) AS percentage\nFROM [SHOW RANGES FROM TABLE your_table_name]\nGROUP BY lease_holder\nORDER BY leaseholder_count DESC;\n",[775],{"type":45,"tag":59,"props":776,"children":777},{"__ignoreMap":225},[778,785,792,800,808,815,823],{"type":45,"tag":231,"props":779,"children":780},{"class":233,"line":234},[781],{"type":45,"tag":231,"props":782,"children":783},{},[784],{"type":50,"value":549},{"type":45,"tag":231,"props":786,"children":787},{"class":233,"line":26},[788],{"type":45,"tag":231,"props":789,"children":790},{},[791],{"type":50,"value":688},{"type":45,"tag":231,"props":793,"children":794},{"class":233,"line":22},[795],{"type":45,"tag":231,"props":796,"children":797},{},[798],{"type":50,"value":799},"  COUNT(*) AS leaseholder_count,\n",{"type":45,"tag":231,"props":801,"children":802},{"class":233,"line":568},[803],{"type":45,"tag":231,"props":804,"children":805},{},[806],{"type":50,"value":807},"  ROUND(COUNT(*) * 100.0 \u002F SUM(COUNT(*)) OVER (), 2) AS percentage\n",{"type":45,"tag":231,"props":809,"children":810},{"class":233,"line":577},[811],{"type":45,"tag":231,"props":812,"children":813},{},[814],{"type":50,"value":583},{"type":45,"tag":231,"props":816,"children":817},{"class":233,"line":586},[818],{"type":45,"tag":231,"props":819,"children":820},{},[821],{"type":50,"value":822},"GROUP BY lease_holder\n",{"type":45,"tag":231,"props":824,"children":825},{"class":233,"line":595},[826],{"type":45,"tag":231,"props":827,"children":828},{},[829],{"type":50,"value":830},"ORDER BY leaseholder_count DESC;\n",{"type":45,"tag":53,"props":832,"children":833},{},[834,838],{"type":45,"tag":79,"props":835,"children":836},{},[837],{"type":50,"value":609},{"type":50,"value":839}," >40% leaseholders on single node in balanced cluster = hotspot. Check if table has zone constraints favoring specific nodes.",{"type":45,"tag":53,"props":841,"children":842},{},[843,848,849,855],{"type":45,"tag":79,"props":844,"children":845},{},[846],{"type":50,"value":847},"Remediation:",{"type":50,"value":159},{"type":45,"tag":59,"props":850,"children":852},{"className":851},[],[853],{"type":50,"value":854},"ALTER TABLE ... CONFIGURE ZONE USING lease_preferences",{"type":50,"value":856}," to spread leaseholders.",{"type":45,"tag":260,"props":858,"children":860},{"id":859},"query-4-range-replication-health-check",[861],{"type":50,"value":862},"Query 4: Range Replication Health Check",{"type":45,"tag":220,"props":864,"children":866},{"className":222,"code":865,"language":224,"meta":225,"style":225},"SELECT\n  range_id,\n  start_key,\n  replicas,\n  array_length(replicas, 1) AS replica_count,\n  voting_replicas,\n  array_length(voting_replicas, 1) AS voting_replica_count,\n  lease_holder\nFROM [SHOW RANGES FROM TABLE your_table_name]\nWHERE array_length(replicas, 1) \u003C 3  -- Under-replicated\nORDER BY range_id\nLIMIT 100;\n",[867],{"type":45,"tag":59,"props":868,"children":869},{"__ignoreMap":225},[870,877,884,891,899,907,915,923,931,938,946,955],{"type":45,"tag":231,"props":871,"children":872},{"class":233,"line":234},[873],{"type":45,"tag":231,"props":874,"children":875},{},[876],{"type":50,"value":549},{"type":45,"tag":231,"props":878,"children":879},{"class":233,"line":26},[880],{"type":45,"tag":231,"props":881,"children":882},{},[883],{"type":50,"value":656},{"type":45,"tag":231,"props":885,"children":886},{"class":233,"line":22},[887],{"type":45,"tag":231,"props":888,"children":889},{},[890],{"type":50,"value":664},{"type":45,"tag":231,"props":892,"children":893},{"class":233,"line":568},[894],{"type":45,"tag":231,"props":895,"children":896},{},[897],{"type":50,"value":898},"  replicas,\n",{"type":45,"tag":231,"props":900,"children":901},{"class":233,"line":577},[902],{"type":45,"tag":231,"props":903,"children":904},{},[905],{"type":50,"value":906},"  array_length(replicas, 1) AS replica_count,\n",{"type":45,"tag":231,"props":908,"children":909},{"class":233,"line":586},[910],{"type":45,"tag":231,"props":911,"children":912},{},[913],{"type":50,"value":914},"  voting_replicas,\n",{"type":45,"tag":231,"props":916,"children":917},{"class":233,"line":595},[918],{"type":45,"tag":231,"props":919,"children":920},{},[921],{"type":50,"value":922},"  array_length(voting_replicas, 1) AS voting_replica_count,\n",{"type":45,"tag":231,"props":924,"children":925},{"class":233,"line":699},[926],{"type":45,"tag":231,"props":927,"children":928},{},[929],{"type":50,"value":930},"  lease_holder\n",{"type":45,"tag":231,"props":932,"children":933},{"class":233,"line":708},[934],{"type":45,"tag":231,"props":935,"children":936},{},[937],{"type":50,"value":583},{"type":45,"tag":231,"props":939,"children":940},{"class":233,"line":717},[941],{"type":45,"tag":231,"props":942,"children":943},{},[944],{"type":50,"value":945},"WHERE array_length(replicas, 1) \u003C 3  -- Under-replicated\n",{"type":45,"tag":231,"props":947,"children":949},{"class":233,"line":948},11,[950],{"type":45,"tag":231,"props":951,"children":952},{},[953],{"type":50,"value":954},"ORDER BY range_id\n",{"type":45,"tag":231,"props":956,"children":958},{"class":233,"line":957},12,[959],{"type":45,"tag":231,"props":960,"children":961},{},[962],{"type":50,"value":963},"LIMIT 100;\n",{"type":45,"tag":53,"props":965,"children":966},{},[967,971,973,979],{"type":45,"tag":79,"props":968,"children":969},{},[970],{"type":50,"value":609},{"type":50,"value":972}," ",{"type":45,"tag":59,"props":974,"children":976},{"className":975},[],[977],{"type":50,"value":978},"replica_count \u003C 3",{"type":50,"value":980}," = under-replicated (data loss risk). Check for node failures, decommissioning operations, or zone config mismatches.",{"type":45,"tag":53,"props":982,"children":983},{},[984,988,989,994],{"type":45,"tag":79,"props":985,"children":986},{},[987],{"type":50,"value":619},{"type":50,"value":621},{"type":45,"tag":59,"props":990,"children":992},{"className":991},[],[993],{"type":50,"value":520},{"type":50,"value":995}," = production-safe.",{"type":45,"tag":260,"props":997,"children":999},{"id":998},"query-5-zone-configuration-audit",[1000],{"type":50,"value":1001},"Query 5: Zone Configuration Audit",{"type":45,"tag":220,"props":1003,"children":1005},{"className":222,"code":1004,"language":224,"meta":225,"style":225},"SHOW ZONE CONFIGURATIONS;\n",[1006],{"type":45,"tag":59,"props":1007,"children":1008},{"__ignoreMap":225},[1009],{"type":45,"tag":231,"props":1010,"children":1011},{"class":233,"line":234},[1012],{"type":45,"tag":231,"props":1013,"children":1014},{},[1015],{"type":50,"value":1004},{"type":45,"tag":53,"props":1017,"children":1018},{},[1019],{"type":45,"tag":79,"props":1020,"children":1021},{},[1022],{"type":50,"value":1023},"Output columns:",{"type":45,"tag":111,"props":1025,"children":1026},{},[1027,1038],{"type":45,"tag":115,"props":1028,"children":1029},{},[1030,1036],{"type":45,"tag":59,"props":1031,"children":1033},{"className":1032},[],[1034],{"type":50,"value":1035},"target",{"type":50,"value":1037},": Database, table, or index",{"type":45,"tag":115,"props":1039,"children":1040},{},[1041,1047],{"type":45,"tag":59,"props":1042,"children":1044},{"className":1043},[],[1045],{"type":50,"value":1046},"raw_config_sql",{"type":50,"value":1048},": Zone config SQL (replication factor, constraints)",{"type":45,"tag":53,"props":1050,"children":1051},{},[1052,1056],{"type":45,"tag":79,"props":1053,"children":1054},{},[1055],{"type":50,"value":429},{"type":50,"value":1057}," Validate intended replication factor and placement constraints match expected design.",{"type":45,"tag":53,"props":1059,"children":1060},{},[1061,1066],{"type":45,"tag":79,"props":1062,"children":1063},{},[1064],{"type":50,"value":1065},"Cross-reference:",{"type":50,"value":1067}," Compare zone configs with Query 3 (leaseholder distribution) and Query 4 (replica health) to validate actual placement.",{"type":45,"tag":260,"props":1069,"children":1071},{"id":1070},"query-6-fragmentation-analysis-ranges-per-gb",[1072],{"type":50,"value":1073},"Query 6: Fragmentation Analysis (Ranges per GB)",{"type":45,"tag":220,"props":1075,"children":1077},{"className":222,"code":1076,"language":224,"meta":225,"style":225},"WITH range_counts AS (\n  SELECT\n    table_name,\n    index_name,\n    COUNT(*) AS range_count\n  FROM [SHOW RANGES FROM TABLE your_table_name]\n  GROUP BY table_name, index_name\n),\ntable_sizes AS (\n  SELECT\n    table_name,\n    SUM((span_stats->>'approximate_disk_bytes')::INT) \u002F 1073741824.0 AS size_gb\n  FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]\n  GROUP BY table_name\n)\nSELECT\n  rc.table_name,\n  rc.index_name,\n  rc.range_count,\n  ts.size_gb,\n  ROUND(rc.range_count \u002F NULLIF(ts.size_gb, 0), 2) AS ranges_per_gb\nFROM range_counts rc\nJOIN table_sizes ts ON rc.table_name = ts.table_name\nORDER BY ranges_per_gb DESC;\n",[1078],{"type":45,"tag":59,"props":1079,"children":1080},{"__ignoreMap":225},[1081,1089,1097,1105,1113,1121,1129,1137,1145,1153,1160,1167,1175,1184,1193,1201,1209,1218,1227,1236,1245,1254,1263,1272],{"type":45,"tag":231,"props":1082,"children":1083},{"class":233,"line":234},[1084],{"type":45,"tag":231,"props":1085,"children":1086},{},[1087],{"type":50,"value":1088},"WITH range_counts AS (\n",{"type":45,"tag":231,"props":1090,"children":1091},{"class":233,"line":26},[1092],{"type":45,"tag":231,"props":1093,"children":1094},{},[1095],{"type":50,"value":1096},"  SELECT\n",{"type":45,"tag":231,"props":1098,"children":1099},{"class":233,"line":22},[1100],{"type":45,"tag":231,"props":1101,"children":1102},{},[1103],{"type":50,"value":1104},"    table_name,\n",{"type":45,"tag":231,"props":1106,"children":1107},{"class":233,"line":568},[1108],{"type":45,"tag":231,"props":1109,"children":1110},{},[1111],{"type":50,"value":1112},"    index_name,\n",{"type":45,"tag":231,"props":1114,"children":1115},{"class":233,"line":577},[1116],{"type":45,"tag":231,"props":1117,"children":1118},{},[1119],{"type":50,"value":1120},"    COUNT(*) AS range_count\n",{"type":45,"tag":231,"props":1122,"children":1123},{"class":233,"line":586},[1124],{"type":45,"tag":231,"props":1125,"children":1126},{},[1127],{"type":50,"value":1128},"  FROM [SHOW RANGES FROM TABLE your_table_name]\n",{"type":45,"tag":231,"props":1130,"children":1131},{"class":233,"line":595},[1132],{"type":45,"tag":231,"props":1133,"children":1134},{},[1135],{"type":50,"value":1136},"  GROUP BY table_name, index_name\n",{"type":45,"tag":231,"props":1138,"children":1139},{"class":233,"line":699},[1140],{"type":45,"tag":231,"props":1141,"children":1142},{},[1143],{"type":50,"value":1144},"),\n",{"type":45,"tag":231,"props":1146,"children":1147},{"class":233,"line":708},[1148],{"type":45,"tag":231,"props":1149,"children":1150},{},[1151],{"type":50,"value":1152},"table_sizes AS (\n",{"type":45,"tag":231,"props":1154,"children":1155},{"class":233,"line":717},[1156],{"type":45,"tag":231,"props":1157,"children":1158},{},[1159],{"type":50,"value":1096},{"type":45,"tag":231,"props":1161,"children":1162},{"class":233,"line":948},[1163],{"type":45,"tag":231,"props":1164,"children":1165},{},[1166],{"type":50,"value":1104},{"type":45,"tag":231,"props":1168,"children":1169},{"class":233,"line":957},[1170],{"type":45,"tag":231,"props":1171,"children":1172},{},[1173],{"type":50,"value":1174},"    SUM((span_stats->>'approximate_disk_bytes')::INT) \u002F 1073741824.0 AS size_gb\n",{"type":45,"tag":231,"props":1176,"children":1178},{"class":233,"line":1177},13,[1179],{"type":45,"tag":231,"props":1180,"children":1181},{},[1182],{"type":50,"value":1183},"  FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]\n",{"type":45,"tag":231,"props":1185,"children":1187},{"class":233,"line":1186},14,[1188],{"type":45,"tag":231,"props":1189,"children":1190},{},[1191],{"type":50,"value":1192},"  GROUP BY table_name\n",{"type":45,"tag":231,"props":1194,"children":1196},{"class":233,"line":1195},15,[1197],{"type":45,"tag":231,"props":1198,"children":1199},{},[1200],{"type":50,"value":283},{"type":45,"tag":231,"props":1202,"children":1204},{"class":233,"line":1203},16,[1205],{"type":45,"tag":231,"props":1206,"children":1207},{},[1208],{"type":50,"value":549},{"type":45,"tag":231,"props":1210,"children":1212},{"class":233,"line":1211},17,[1213],{"type":45,"tag":231,"props":1214,"children":1215},{},[1216],{"type":50,"value":1217},"  rc.table_name,\n",{"type":45,"tag":231,"props":1219,"children":1221},{"class":233,"line":1220},18,[1222],{"type":45,"tag":231,"props":1223,"children":1224},{},[1225],{"type":50,"value":1226},"  rc.index_name,\n",{"type":45,"tag":231,"props":1228,"children":1230},{"class":233,"line":1229},19,[1231],{"type":45,"tag":231,"props":1232,"children":1233},{},[1234],{"type":50,"value":1235},"  rc.range_count,\n",{"type":45,"tag":231,"props":1237,"children":1239},{"class":233,"line":1238},20,[1240],{"type":45,"tag":231,"props":1241,"children":1242},{},[1243],{"type":50,"value":1244},"  ts.size_gb,\n",{"type":45,"tag":231,"props":1246,"children":1248},{"class":233,"line":1247},21,[1249],{"type":45,"tag":231,"props":1250,"children":1251},{},[1252],{"type":50,"value":1253},"  ROUND(rc.range_count \u002F NULLIF(ts.size_gb, 0), 2) AS ranges_per_gb\n",{"type":45,"tag":231,"props":1255,"children":1257},{"class":233,"line":1256},22,[1258],{"type":45,"tag":231,"props":1259,"children":1260},{},[1261],{"type":50,"value":1262},"FROM range_counts rc\n",{"type":45,"tag":231,"props":1264,"children":1266},{"class":233,"line":1265},23,[1267],{"type":45,"tag":231,"props":1268,"children":1269},{},[1270],{"type":50,"value":1271},"JOIN table_sizes ts ON rc.table_name = ts.table_name\n",{"type":45,"tag":231,"props":1273,"children":1275},{"class":233,"line":1274},24,[1276],{"type":45,"tag":231,"props":1277,"children":1278},{},[1279],{"type":50,"value":1280},"ORDER BY ranges_per_gb DESC;\n",{"type":45,"tag":53,"props":1282,"children":1283},{},[1284],{"type":45,"tag":79,"props":1285,"children":1286},{},[1287],{"type":50,"value":609},{"type":45,"tag":111,"props":1289,"children":1290},{},[1291,1301,1311],{"type":45,"tag":115,"props":1292,"children":1293},{},[1294,1299],{"type":45,"tag":79,"props":1295,"children":1296},{},[1297],{"type":50,"value":1298},"Healthy:",{"type":50,"value":1300}," 1-15 ranges\u002FGB",{"type":45,"tag":115,"props":1302,"children":1303},{},[1304,1309],{"type":45,"tag":79,"props":1305,"children":1306},{},[1307],{"type":50,"value":1308},"Moderate fragmentation:",{"type":50,"value":1310}," 16-50 ranges\u002FGB",{"type":45,"tag":115,"props":1312,"children":1313},{},[1314,1319],{"type":45,"tag":79,"props":1315,"children":1316},{},[1317],{"type":50,"value":1318},"Severe fragmentation:",{"type":50,"value":1320}," 50+ ranges\u002FGB",{"type":45,"tag":53,"props":1322,"children":1323},{},[1324,1328,1330,1335],{"type":45,"tag":79,"props":1325,"children":1326},{},[1327],{"type":50,"value":747},{"type":50,"value":1329}," This query uses ",{"type":45,"tag":59,"props":1331,"children":1333},{"className":1332},[],[1334],{"type":50,"value":520},{"type":50,"value":1336}," - only run on targeted tables with known size, never cluster-wide.",{"type":45,"tag":53,"props":1338,"children":1339},{},[1340,1344,1346,1351],{"type":45,"tag":79,"props":1341,"children":1342},{},[1343],{"type":50,"value":847},{"type":50,"value":1345}," Increase ",{"type":45,"tag":59,"props":1347,"children":1349},{"className":1348},[],[1350],{"type":50,"value":281},{"type":50,"value":1352}," via zone config (with caution), or accept fragmentation if caused by necessary load-based splitting.",{"type":45,"tag":53,"props":1354,"children":1355},{},[1356,1357,1363],{"type":50,"value":244},{"type":45,"tag":87,"props":1358,"children":1360},{"href":1359},"references\u002Fsql-queries.md",[1361],{"type":50,"value":1362},"sql-queries reference",{"type":50,"value":1364}," for complete query variations and guardrails.",{"type":45,"tag":104,"props":1366,"children":1368},{"id":1367},"common-workflows",[1369],{"type":50,"value":1370},"Common Workflows",{"type":45,"tag":260,"props":1372,"children":1374},{"id":1373},"workflow-1-hotspot-investigation",[1375],{"type":50,"value":1376},"Workflow 1: Hotspot Investigation",{"type":45,"tag":53,"props":1378,"children":1379},{},[1380,1385],{"type":45,"tag":79,"props":1381,"children":1382},{},[1383],{"type":50,"value":1384},"Scenario:",{"type":50,"value":1386}," Single node experiencing high CPU, slow reads on specific table.",{"type":45,"tag":53,"props":1388,"children":1389},{},[1390],{"type":45,"tag":79,"props":1391,"children":1392},{},[1393],{"type":50,"value":1394},"Steps:",{"type":45,"tag":1396,"props":1397,"children":1398},"ol",{},[1399,1409,1419,1429],{"type":45,"tag":115,"props":1400,"children":1401},{},[1402,1407],{"type":45,"tag":79,"props":1403,"children":1404},{},[1405],{"type":50,"value":1406},"Identify leaseholder concentration:",{"type":50,"value":1408}," Run Query 3 on suspected table",{"type":45,"tag":115,"props":1410,"children":1411},{},[1412,1417],{"type":45,"tag":79,"props":1413,"children":1414},{},[1415],{"type":50,"value":1416},"Validate zone config:",{"type":50,"value":1418}," Run Query 5 to check lease_preferences",{"type":45,"tag":115,"props":1420,"children":1421},{},[1422,1427],{"type":45,"tag":79,"props":1423,"children":1424},{},[1425],{"type":50,"value":1426},"Check for load-based splits:",{"type":50,"value":1428}," Run Query 1 to detect recent range fragmentation (symptom of hotspot)",{"type":45,"tag":115,"props":1430,"children":1431},{},[1432,1437],{"type":45,"tag":79,"props":1433,"children":1434},{},[1435],{"type":50,"value":1436},"Remediate:",{"type":50,"value":1438}," Configure lease preferences to spread reads, or partition table if hotspot is on sequential key range",{"type":45,"tag":53,"props":1440,"children":1441},{},[1442],{"type":45,"tag":79,"props":1443,"children":1444},{},[1445],{"type":50,"value":1446},"Example:",{"type":45,"tag":220,"props":1448,"children":1450},{"className":222,"code":1449,"language":224,"meta":225,"style":225},"-- Check leaseholder distribution\nSELECT lease_holder, COUNT(*) FROM [SHOW RANGES FROM TABLE hot_table] GROUP BY lease_holder;\n\n-- Validate zone config\nSHOW ZONE CONFIGURATION FOR TABLE hot_table;\n\n-- Spread leaseholders if concentrated\nALTER TABLE hot_table CONFIGURE ZONE USING lease_preferences = '[[+region=us-west]]';\n",[1451],{"type":45,"tag":59,"props":1452,"children":1453},{"__ignoreMap":225},[1454,1462,1470,1479,1487,1495,1502,1510],{"type":45,"tag":231,"props":1455,"children":1456},{"class":233,"line":234},[1457],{"type":45,"tag":231,"props":1458,"children":1459},{},[1460],{"type":50,"value":1461},"-- Check leaseholder distribution\n",{"type":45,"tag":231,"props":1463,"children":1464},{"class":233,"line":26},[1465],{"type":45,"tag":231,"props":1466,"children":1467},{},[1468],{"type":50,"value":1469},"SELECT lease_holder, COUNT(*) FROM [SHOW RANGES FROM TABLE hot_table] GROUP BY lease_holder;\n",{"type":45,"tag":231,"props":1471,"children":1472},{"class":233,"line":22},[1473],{"type":45,"tag":231,"props":1474,"children":1476},{"emptyLinePlaceholder":1475},true,[1477],{"type":50,"value":1478},"\n",{"type":45,"tag":231,"props":1480,"children":1481},{"class":233,"line":568},[1482],{"type":45,"tag":231,"props":1483,"children":1484},{},[1485],{"type":50,"value":1486},"-- Validate zone config\n",{"type":45,"tag":231,"props":1488,"children":1489},{"class":233,"line":577},[1490],{"type":45,"tag":231,"props":1491,"children":1492},{},[1493],{"type":50,"value":1494},"SHOW ZONE CONFIGURATION FOR TABLE hot_table;\n",{"type":45,"tag":231,"props":1496,"children":1497},{"class":233,"line":586},[1498],{"type":45,"tag":231,"props":1499,"children":1500},{"emptyLinePlaceholder":1475},[1501],{"type":50,"value":1478},{"type":45,"tag":231,"props":1503,"children":1504},{"class":233,"line":595},[1505],{"type":45,"tag":231,"props":1506,"children":1507},{},[1508],{"type":50,"value":1509},"-- Spread leaseholders if concentrated\n",{"type":45,"tag":231,"props":1511,"children":1512},{"class":233,"line":699},[1513],{"type":45,"tag":231,"props":1514,"children":1515},{},[1516],{"type":50,"value":1517},"ALTER TABLE hot_table CONFIGURE ZONE USING lease_preferences = '[[+region=us-west]]';\n",{"type":45,"tag":260,"props":1519,"children":1521},{"id":1520},"workflow-2-zone-config-validation",[1522],{"type":50,"value":1523},"Workflow 2: Zone Config Validation",{"type":45,"tag":53,"props":1525,"children":1526},{},[1527,1531],{"type":45,"tag":79,"props":1528,"children":1529},{},[1530],{"type":50,"value":1384},{"type":50,"value":1532}," After configuring multi-region setup, validate ranges are placed according to constraints.",{"type":45,"tag":53,"props":1534,"children":1535},{},[1536],{"type":45,"tag":79,"props":1537,"children":1538},{},[1539],{"type":50,"value":1394},{"type":45,"tag":1396,"props":1541,"children":1542},{},[1543,1553,1571,1602],{"type":45,"tag":115,"props":1544,"children":1545},{},[1546,1551],{"type":45,"tag":79,"props":1547,"children":1548},{},[1549],{"type":50,"value":1550},"Review intended configs:",{"type":50,"value":1552}," Run Query 5 (SHOW ZONE CONFIGURATIONS)",{"type":45,"tag":115,"props":1554,"children":1555},{},[1556,1561,1563,1569],{"type":45,"tag":79,"props":1557,"children":1558},{},[1559],{"type":50,"value":1560},"Check actual replica placement:",{"type":50,"value":1562}," Run Query 4 on critical tables, inspect ",{"type":45,"tag":59,"props":1564,"children":1566},{"className":1565},[],[1567],{"type":50,"value":1568},"replicas",{"type":50,"value":1570}," array for node IDs",{"type":45,"tag":115,"props":1572,"children":1573},{},[1574,1579,1580,1586,1588,1594,1596],{"type":45,"tag":79,"props":1575,"children":1576},{},[1577],{"type":50,"value":1578},"Map node IDs to regions:",{"type":50,"value":159},{"type":45,"tag":59,"props":1581,"children":1583},{"className":1582},[],[1584],{"type":50,"value":1585},"SHOW REGIONS",{"type":50,"value":1587}," (cluster-wide) or read the ",{"type":45,"tag":59,"props":1589,"children":1591},{"className":1590},[],[1592],{"type":50,"value":1593},"locality",{"type":50,"value":1595}," column of ",{"type":45,"tag":59,"props":1597,"children":1599},{"className":1598},[],[1600],{"type":50,"value":1601},"cockroach node status",{"type":45,"tag":115,"props":1603,"children":1604},{},[1605,1610],{"type":45,"tag":79,"props":1606,"children":1607},{},[1608],{"type":50,"value":1609},"Identify mismatches:",{"type":50,"value":1611}," Ranges not matching constraints indicate rebalancing in progress or misconfiguration",{"type":45,"tag":53,"props":1613,"children":1614},{},[1615],{"type":45,"tag":79,"props":1616,"children":1617},{},[1618],{"type":50,"value":1446},{"type":45,"tag":220,"props":1620,"children":1622},{"className":222,"code":1621,"language":224,"meta":225,"style":225},"-- Show zone config\nSHOW ZONE CONFIGURATION FOR TABLE multi_region_table;\n\n-- Check replica placement\nSELECT range_id, replicas FROM [SHOW RANGES FROM TABLE multi_region_table] LIMIT 20;\n\n-- Map node IDs to regions (cluster-level view)\nSHOW REGIONS;\n-- For per-node locality strings, use the CLI:\n--   cockroach node status --certs-dir=\u003Ccerts-dir> --host=\u003Cany-live-node>\n",[1623],{"type":45,"tag":59,"props":1624,"children":1625},{"__ignoreMap":225},[1626,1634,1642,1649,1657,1665,1672,1680,1688,1696],{"type":45,"tag":231,"props":1627,"children":1628},{"class":233,"line":234},[1629],{"type":45,"tag":231,"props":1630,"children":1631},{},[1632],{"type":50,"value":1633},"-- Show zone config\n",{"type":45,"tag":231,"props":1635,"children":1636},{"class":233,"line":26},[1637],{"type":45,"tag":231,"props":1638,"children":1639},{},[1640],{"type":50,"value":1641},"SHOW ZONE CONFIGURATION FOR TABLE multi_region_table;\n",{"type":45,"tag":231,"props":1643,"children":1644},{"class":233,"line":22},[1645],{"type":45,"tag":231,"props":1646,"children":1647},{"emptyLinePlaceholder":1475},[1648],{"type":50,"value":1478},{"type":45,"tag":231,"props":1650,"children":1651},{"class":233,"line":568},[1652],{"type":45,"tag":231,"props":1653,"children":1654},{},[1655],{"type":50,"value":1656},"-- Check replica placement\n",{"type":45,"tag":231,"props":1658,"children":1659},{"class":233,"line":577},[1660],{"type":45,"tag":231,"props":1661,"children":1662},{},[1663],{"type":50,"value":1664},"SELECT range_id, replicas FROM [SHOW RANGES FROM TABLE multi_region_table] LIMIT 20;\n",{"type":45,"tag":231,"props":1666,"children":1667},{"class":233,"line":586},[1668],{"type":45,"tag":231,"props":1669,"children":1670},{"emptyLinePlaceholder":1475},[1671],{"type":50,"value":1478},{"type":45,"tag":231,"props":1673,"children":1674},{"class":233,"line":595},[1675],{"type":45,"tag":231,"props":1676,"children":1677},{},[1678],{"type":50,"value":1679},"-- Map node IDs to regions (cluster-level view)\n",{"type":45,"tag":231,"props":1681,"children":1682},{"class":233,"line":699},[1683],{"type":45,"tag":231,"props":1684,"children":1685},{},[1686],{"type":50,"value":1687},"SHOW REGIONS;\n",{"type":45,"tag":231,"props":1689,"children":1690},{"class":233,"line":708},[1691],{"type":45,"tag":231,"props":1692,"children":1693},{},[1694],{"type":50,"value":1695},"-- For per-node locality strings, use the CLI:\n",{"type":45,"tag":231,"props":1697,"children":1698},{"class":233,"line":717},[1699],{"type":45,"tag":231,"props":1700,"children":1701},{},[1702],{"type":50,"value":1703},"--   cockroach node status --certs-dir=\u003Ccerts-dir> --host=\u003Cany-live-node>\n",{"type":45,"tag":260,"props":1705,"children":1707},{"id":1706},"workflow-3-fragmentation-diagnosis",[1708],{"type":50,"value":1709},"Workflow 3: Fragmentation Diagnosis",{"type":45,"tag":53,"props":1711,"children":1712},{},[1713,1717],{"type":45,"tag":79,"props":1714,"children":1715},{},[1716],{"type":50,"value":1384},{"type":50,"value":1718}," Table with high range count relative to size, experiencing latency.",{"type":45,"tag":53,"props":1720,"children":1721},{},[1722],{"type":45,"tag":79,"props":1723,"children":1724},{},[1725],{"type":50,"value":1394},{"type":45,"tag":1396,"props":1727,"children":1728},{},[1729,1739,1748,1758],{"type":45,"tag":115,"props":1730,"children":1731},{},[1732,1737],{"type":45,"tag":79,"props":1733,"children":1734},{},[1735],{"type":50,"value":1736},"Calculate ranges per GB:",{"type":50,"value":1738}," Run Query 6 (targeted to specific table)",{"type":45,"tag":115,"props":1740,"children":1741},{},[1742,1746],{"type":45,"tag":79,"props":1743,"children":1744},{},[1745],{"type":50,"value":1426},{"type":50,"value":1747}," Review write patterns (sequential inserts, high QPS periods)",{"type":45,"tag":115,"props":1749,"children":1750},{},[1751,1756],{"type":45,"tag":79,"props":1752,"children":1753},{},[1754],{"type":50,"value":1755},"Determine if expected:",{"type":50,"value":1757}," Fragmentation may be intentional for load distribution",{"type":45,"tag":115,"props":1759,"children":1760},{},[1761,1766,1767,1772],{"type":45,"tag":79,"props":1762,"children":1763},{},[1764],{"type":50,"value":1765},"Remediate if excessive:",{"type":50,"value":1345},{"type":45,"tag":59,"props":1768,"children":1770},{"className":1769},[],[1771],{"type":50,"value":281},{"type":50,"value":1773}," (with caution - larger ranges = slower splits), or investigate reducing write hotspots",{"type":45,"tag":53,"props":1775,"children":1776},{},[1777,1781,1782,1787],{"type":45,"tag":79,"props":1778,"children":1779},{},[1780],{"type":50,"value":747},{"type":50,"value":972},{"type":45,"tag":59,"props":1783,"children":1785},{"className":1784},[],[1786],{"type":50,"value":281},{"type":50,"value":1788}," defaults to 512MB. Raising it further without understanding the impact on split\u002Frebalance performance is risky.",{"type":45,"tag":104,"props":1790,"children":1792},{"id":1791},"safety-considerations",[1793],{"type":50,"value":1794},"Safety Considerations",{"type":45,"tag":260,"props":1796,"children":1798},{"id":1797},"details-option-cost",[1799],{"type":50,"value":1800},"DETAILS Option Cost",{"type":45,"tag":53,"props":1802,"children":1803},{},[1804],{"type":45,"tag":79,"props":1805,"children":1806},{},[1807],{"type":50,"value":1808},"Resource impact:",{"type":45,"tag":111,"props":1810,"children":1811},{},[1812,1822,1832],{"type":45,"tag":115,"props":1813,"children":1814},{},[1815,1820],{"type":45,"tag":79,"props":1816,"children":1817},{},[1818],{"type":50,"value":1819},"CPU:",{"type":50,"value":1821}," Computes span statistics on-demand for each range",{"type":45,"tag":115,"props":1823,"children":1824},{},[1825,1830],{"type":45,"tag":79,"props":1826,"children":1827},{},[1828],{"type":50,"value":1829},"Memory:",{"type":50,"value":1831}," Proportional to range count returned",{"type":45,"tag":115,"props":1833,"children":1834},{},[1835,1840],{"type":45,"tag":79,"props":1836,"children":1837},{},[1838],{"type":50,"value":1839},"Timeout risk:",{"type":50,"value":1841}," High on tables with 1000s of ranges without LIMIT",{"type":45,"tag":53,"props":1843,"children":1844},{},[1845],{"type":45,"tag":79,"props":1846,"children":1847},{},[1848],{"type":50,"value":1849},"Mitigation strategies:",{"type":45,"tag":1396,"props":1851,"children":1852},{},[1853,1863,1885,1895],{"type":45,"tag":115,"props":1854,"children":1855},{},[1856,1861],{"type":45,"tag":79,"props":1857,"children":1858},{},[1859],{"type":50,"value":1860},"Always use LIMIT:",{"type":50,"value":1862}," Cap at 50-100 ranges for exploratory analysis",{"type":45,"tag":115,"props":1864,"children":1865},{},[1866,1871,1872,1878,1880],{"type":45,"tag":79,"props":1867,"children":1868},{},[1869],{"type":50,"value":1870},"Target specific tables:",{"type":50,"value":159},{"type":45,"tag":59,"props":1873,"children":1875},{"className":1874},[],[1876],{"type":50,"value":1877},"FROM TABLE table_name",{"type":50,"value":1879},", never cluster-wide ",{"type":45,"tag":59,"props":1881,"children":1883},{"className":1882},[],[1884],{"type":50,"value":762},{"type":45,"tag":115,"props":1886,"children":1887},{},[1888,1893],{"type":45,"tag":79,"props":1889,"children":1890},{},[1891],{"type":50,"value":1892},"Use basic queries first:",{"type":50,"value":1894}," Run Query 1 (no DETAILS) to assess range count before using DETAILS",{"type":45,"tag":115,"props":1896,"children":1897},{},[1898,1903],{"type":45,"tag":79,"props":1899,"children":1900},{},[1901],{"type":50,"value":1902},"Production timing:",{"type":50,"value":1904}," Run during maintenance windows or low-traffic periods",{"type":45,"tag":260,"props":1906,"children":1908},{"id":1907},"privilege-safety",[1909],{"type":50,"value":1910},"Privilege Safety",{"type":45,"tag":53,"props":1912,"children":1913},{},[1914,1919,1921,1926],{"type":45,"tag":79,"props":1915,"children":1916},{},[1917],{"type":50,"value":1918},"Admin role:",{"type":50,"value":1920}," Full cluster access, use with caution in production\n",{"type":45,"tag":79,"props":1922,"children":1923},{},[1924],{"type":50,"value":1925},"ZONECONFIG privilege:",{"type":50,"value":1927}," Limited to viewing ranges and zone configs, safer for read-only analysis",{"type":45,"tag":53,"props":1929,"children":1930},{},[1931,1935,1937,1942],{"type":45,"tag":79,"props":1932,"children":1933},{},[1934],{"type":50,"value":504},{"type":50,"value":1936}," Grant ",{"type":45,"tag":59,"props":1938,"children":1940},{"className":1939},[],[1941],{"type":50,"value":190},{"type":50,"value":1943}," instead of admin for range analysis operators.",{"type":45,"tag":53,"props":1945,"children":1946},{},[1947,1948,1952],{"type":50,"value":244},{"type":45,"tag":87,"props":1949,"children":1950},{"href":247},[1951],{"type":50,"value":250},{"type":50,"value":1953}," for granting minimal privileges.",{"type":45,"tag":260,"props":1955,"children":1957},{"id":1956},"production-impact",[1958],{"type":50,"value":1959},"Production Impact",{"type":45,"tag":53,"props":1961,"children":1962},{},[1963,1968,1970,1976,1978,1984],{"type":45,"tag":79,"props":1964,"children":1965},{},[1966],{"type":50,"value":1967},"Read-only operations:",{"type":50,"value":1969}," All queries are ",{"type":45,"tag":59,"props":1971,"children":1973},{"className":1972},[],[1974],{"type":50,"value":1975},"SELECT",{"type":50,"value":1977}," or ",{"type":45,"tag":59,"props":1979,"children":1981},{"className":1980},[],[1982],{"type":50,"value":1983},"SHOW",{"type":50,"value":1985}," statements with no writes.",{"type":45,"tag":53,"props":1987,"children":1988},{},[1989],{"type":45,"tag":79,"props":1990,"children":1991},{},[1992],{"type":50,"value":1993},"Performance considerations:",{"type":45,"tag":1995,"props":1996,"children":1997},"table",{},[1998,2022],{"type":45,"tag":1999,"props":2000,"children":2001},"thead",{},[2002],{"type":45,"tag":2003,"props":2004,"children":2005},"tr",{},[2006,2012,2017],{"type":45,"tag":2007,"props":2008,"children":2009},"th",{},[2010],{"type":50,"value":2011},"Query Type",{"type":45,"tag":2007,"props":2013,"children":2014},{},[2015],{"type":50,"value":2016},"Impact",{"type":45,"tag":2007,"props":2018,"children":2019},{},[2020],{"type":50,"value":2021},"Safe for Production?",{"type":45,"tag":2023,"props":2024,"children":2025},"tbody",{},[2026,2045,2063,2084],{"type":45,"tag":2003,"props":2027,"children":2028},{},[2029,2035,2040],{"type":45,"tag":2030,"props":2031,"children":2032},"td",{},[2033],{"type":50,"value":2034},"Basic SHOW RANGES",{"type":45,"tag":2030,"props":2036,"children":2037},{},[2038],{"type":50,"value":2039},"Minimal CPU, metadata-only",{"type":45,"tag":2030,"props":2041,"children":2042},{},[2043],{"type":50,"value":2044},"Yes",{"type":45,"tag":2003,"props":2046,"children":2047},{},[2048,2053,2058],{"type":45,"tag":2030,"props":2049,"children":2050},{},[2051],{"type":50,"value":2052},"SHOW RANGES WITH DETAILS (targeted, LIMIT 50)",{"type":45,"tag":2030,"props":2054,"children":2055},{},[2056],{"type":50,"value":2057},"Moderate CPU spike",{"type":45,"tag":2030,"props":2059,"children":2060},{},[2061],{"type":50,"value":2062},"Yes (low-traffic window)",{"type":45,"tag":2003,"props":2064,"children":2065},{},[2066,2071,2076],{"type":45,"tag":2030,"props":2067,"children":2068},{},[2069],{"type":50,"value":2070},"SHOW RANGES WITH DETAILS (no LIMIT)",{"type":45,"tag":2030,"props":2072,"children":2073},{},[2074],{"type":50,"value":2075},"High CPU, timeout risk",{"type":45,"tag":2030,"props":2077,"children":2078},{},[2079],{"type":45,"tag":79,"props":2080,"children":2081},{},[2082],{"type":50,"value":2083},"NO - NEVER USE",{"type":45,"tag":2003,"props":2085,"children":2086},{},[2087,2091,2096],{"type":45,"tag":2030,"props":2088,"children":2089},{},[2090],{"type":50,"value":72},{"type":45,"tag":2030,"props":2092,"children":2093},{},[2094],{"type":50,"value":2095},"Minimal, metadata-only",{"type":45,"tag":2030,"props":2097,"children":2098},{},[2099],{"type":50,"value":2044},{"type":45,"tag":104,"props":2101,"children":2103},{"id":2102},"troubleshooting",[2104],{"type":50,"value":2105},"Troubleshooting",{"type":45,"tag":1995,"props":2107,"children":2108},{},[2109,2130],{"type":45,"tag":1999,"props":2110,"children":2111},{},[2112],{"type":45,"tag":2003,"props":2113,"children":2114},{},[2115,2120,2125],{"type":45,"tag":2007,"props":2116,"children":2117},{},[2118],{"type":50,"value":2119},"Issue",{"type":45,"tag":2007,"props":2121,"children":2122},{},[2123],{"type":50,"value":2124},"Cause",{"type":45,"tag":2007,"props":2126,"children":2127},{},[2128],{"type":50,"value":2129},"Fix",{"type":45,"tag":2023,"props":2131,"children":2132},{},[2133,2157,2183,2207,2225,2243,2261],{"type":45,"tag":2003,"props":2134,"children":2135},{},[2136,2141,2146],{"type":45,"tag":2030,"props":2137,"children":2138},{},[2139],{"type":50,"value":2140},"Permission denied",{"type":45,"tag":2030,"props":2142,"children":2143},{},[2144],{"type":50,"value":2145},"Missing admin or ZONECONFIG privilege",{"type":45,"tag":2030,"props":2147,"children":2148},{},[2149,2151],{"type":50,"value":2150},"Grant ZONECONFIG: ",{"type":45,"tag":59,"props":2152,"children":2154},{"className":2153},[],[2155],{"type":50,"value":2156},"GRANT SYSTEM ZONECONFIG TO user",{"type":45,"tag":2003,"props":2158,"children":2159},{},[2160,2165,2170],{"type":45,"tag":2030,"props":2161,"children":2162},{},[2163],{"type":50,"value":2164},"Query timeout with DETAILS",{"type":45,"tag":2030,"props":2166,"children":2167},{},[2168],{"type":50,"value":2169},"Too many ranges without LIMIT",{"type":45,"tag":2030,"props":2171,"children":2172},{},[2173,2175,2181],{"type":50,"value":2174},"Add ",{"type":45,"tag":59,"props":2176,"children":2178},{"className":2177},[],[2179],{"type":50,"value":2180},"LIMIT 50",{"type":50,"value":2182},", target specific table",{"type":45,"tag":2003,"props":2184,"children":2185},{},[2186,2191,2196],{"type":45,"tag":2030,"props":2187,"children":2188},{},[2189],{"type":50,"value":2190},"Empty span_stats column",{"type":45,"tag":2030,"props":2192,"children":2193},{},[2194],{"type":50,"value":2195},"Missing DETAILS keyword",{"type":45,"tag":2030,"props":2197,"children":2198},{},[2199,2200,2205],{"type":50,"value":2174},{"type":45,"tag":59,"props":2201,"children":2203},{"className":2202},[],[2204],{"type":50,"value":453},{"type":50,"value":2206}," to SHOW RANGES",{"type":45,"tag":2003,"props":2208,"children":2209},{},[2210,2215,2220],{"type":45,"tag":2030,"props":2211,"children":2212},{},[2213],{"type":50,"value":2214},"Unexpected high range count",{"type":45,"tag":2030,"props":2216,"children":2217},{},[2218],{"type":50,"value":2219},"Load-based splitting or fragmentation",{"type":45,"tag":2030,"props":2221,"children":2222},{},[2223],{"type":50,"value":2224},"Run Query 6 to calculate ranges\u002FGB, review write patterns",{"type":45,"tag":2003,"props":2226,"children":2227},{},[2228,2233,2238],{"type":45,"tag":2030,"props":2229,"children":2230},{},[2231],{"type":50,"value":2232},"Leaseholder = 0 or NULL",{"type":45,"tag":2030,"props":2234,"children":2235},{},[2236],{"type":50,"value":2237},"Range in transition during rebalancing",{"type":45,"tag":2030,"props":2239,"children":2240},{},[2241],{"type":50,"value":2242},"Normal during cluster changes, retry query",{"type":45,"tag":2003,"props":2244,"children":2245},{},[2246,2251,2256],{"type":45,"tag":2030,"props":2247,"children":2248},{},[2249],{"type":50,"value":2250},"Under-replicated ranges",{"type":45,"tag":2030,"props":2252,"children":2253},{},[2254],{"type":50,"value":2255},"Node failure, decommission, zone mismatch",{"type":45,"tag":2030,"props":2257,"children":2258},{},[2259],{"type":50,"value":2260},"Check node status, validate zone config constraints",{"type":45,"tag":2003,"props":2262,"children":2263},{},[2264,2269,2274],{"type":45,"tag":2030,"props":2265,"children":2266},{},[2267],{"type":50,"value":2268},"SHOW ZONE CONFIGURATIONS shows no custom configs",{"type":45,"tag":2030,"props":2270,"children":2271},{},[2272],{"type":50,"value":2273},"Using default cluster-wide config",{"type":45,"tag":2030,"props":2275,"children":2276},{},[2277],{"type":50,"value":2278},"Normal if no table\u002Fdatabase-level overrides set",{"type":45,"tag":104,"props":2280,"children":2282},{"id":2281},"key-considerations",[2283],{"type":50,"value":2284},"Key Considerations",{"type":45,"tag":111,"props":2286,"children":2287},{},[2288,2298,2308,2317,2340,2350,2360],{"type":45,"tag":115,"props":2289,"children":2290},{},[2291,2296],{"type":45,"tag":79,"props":2292,"children":2293},{},[2294],{"type":50,"value":2295},"DETAILS option:",{"type":50,"value":2297}," Expensive operation - always use with LIMIT and targeted scope",{"type":45,"tag":115,"props":2299,"children":2300},{},[2301,2306],{"type":45,"tag":79,"props":2302,"children":2303},{},[2304],{"type":50,"value":2305},"Fragmentation is sometimes intentional:",{"type":50,"value":2307}," Load-based splitting improves concurrency",{"type":45,"tag":115,"props":2309,"children":2310},{},[2311,2315],{"type":45,"tag":79,"props":2312,"children":2313},{},[2314],{"type":50,"value":328},{"type":50,"value":2316}," Check zone configs (lease_preferences) before assuming hotspot",{"type":45,"tag":115,"props":2318,"children":2319},{},[2320,2325,2327,2332,2334,2339],{"type":45,"tag":79,"props":2321,"children":2322},{},[2323],{"type":50,"value":2324},"Range size target:",{"type":50,"value":2326}," Default ",{"type":45,"tag":59,"props":2328,"children":2330},{"className":2329},[],[2331],{"type":50,"value":281},{"type":50,"value":2333}," is 512MB (verify with ",{"type":45,"tag":59,"props":2335,"children":2337},{"className":2336},[],[2338],{"type":50,"value":203},{"type":50,"value":205},{"type":45,"tag":115,"props":2341,"children":2342},{},[2343,2348],{"type":45,"tag":79,"props":2344,"children":2345},{},[2346],{"type":50,"value":2347},"Replication lag:",{"type":50,"value":2349}," Range placement may not immediately reflect zone config changes (rebalancing takes time)",{"type":45,"tag":115,"props":2351,"children":2352},{},[2353,2358],{"type":45,"tag":79,"props":2354,"children":2355},{},[2356],{"type":50,"value":2357},"Cross-reference queries:",{"type":50,"value":2359}," Combine range analysis with zone configs for complete picture",{"type":45,"tag":115,"props":2361,"children":2362},{},[2363,2368,2369,2374,2376,2381],{"type":45,"tag":79,"props":2364,"children":2365},{},[2366],{"type":50,"value":2367},"Node mapping:",{"type":50,"value":159},{"type":45,"tag":59,"props":2370,"children":2372},{"className":2371},[],[2373],{"type":50,"value":1585},{"type":50,"value":2375}," for cluster-level locality, or ",{"type":45,"tag":59,"props":2377,"children":2379},{"className":2378},[],[2380],{"type":50,"value":1601},{"type":50,"value":2382}," for per-node locality",{"type":45,"tag":104,"props":2384,"children":2386},{"id":2385},"references",[2387],{"type":50,"value":2388},"References",{"type":45,"tag":53,"props":2390,"children":2391},{},[2392],{"type":45,"tag":79,"props":2393,"children":2394},{},[2395],{"type":50,"value":2396},"Skill references:",{"type":45,"tag":111,"props":2398,"children":2399},{},[2400,2408],{"type":45,"tag":115,"props":2401,"children":2402},{},[2403],{"type":45,"tag":87,"props":2404,"children":2405},{"href":1359},[2406],{"type":50,"value":2407},"SQL query variations and guardrails",{"type":45,"tag":115,"props":2409,"children":2410},{},[2411],{"type":45,"tag":87,"props":2412,"children":2413},{"href":247},[2414],{"type":50,"value":2415},"RBAC and privileges setup",{"type":45,"tag":53,"props":2417,"children":2418},{},[2419],{"type":45,"tag":79,"props":2420,"children":2421},{},[2422],{"type":50,"value":2423},"Official CockroachDB Documentation:",{"type":45,"tag":111,"props":2425,"children":2426},{},[2427,2437,2446,2456,2466],{"type":45,"tag":115,"props":2428,"children":2429},{},[2430],{"type":45,"tag":87,"props":2431,"children":2435},{"href":2432,"rel":2433},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-ranges.html",[2434],"nofollow",[2436],{"type":50,"value":64},{"type":45,"tag":115,"props":2438,"children":2439},{},[2440],{"type":45,"tag":87,"props":2441,"children":2444},{"href":2442,"rel":2443},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fshow-zone-configurations.html",[2434],[2445],{"type":50,"value":72},{"type":45,"tag":115,"props":2447,"children":2448},{},[2449],{"type":45,"tag":87,"props":2450,"children":2453},{"href":2451,"rel":2452},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Farchitecture\u002Fdistribution-layer.html",[2434],[2454],{"type":50,"value":2455},"Architecture: Distribution Layer",{"type":45,"tag":115,"props":2457,"children":2458},{},[2459],{"type":45,"tag":87,"props":2460,"children":2463},{"href":2461,"rel":2462},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fconfigure-replication-zones.html",[2434],[2464],{"type":50,"value":2465},"Configure Replication Zones",{"type":45,"tag":115,"props":2467,"children":2468},{},[2469],{"type":45,"tag":87,"props":2470,"children":2473},{"href":2471,"rel":2472},"https:\u002F\u002Fwww.cockroachlabs.com\u002Fdocs\u002Fstable\u002Fsecurity-reference\u002Fauthorization.html#supported-privileges",[2434],[2474],{"type":50,"value":2475},"ZONECONFIG privilege",{"type":45,"tag":53,"props":2477,"children":2478},{},[2479],{"type":45,"tag":79,"props":2480,"children":2481},{},[2482],{"type":50,"value":2483},"Related skills:",{"type":45,"tag":111,"props":2485,"children":2486},{},[2487,2496,2507],{"type":45,"tag":115,"props":2488,"children":2489},{},[2490,2494],{"type":45,"tag":87,"props":2491,"children":2492},{"href":89},[2493],{"type":50,"value":92},{"type":50,"value":2495}," - For query performance analysis",{"type":45,"tag":115,"props":2497,"children":2498},{},[2499,2505],{"type":45,"tag":87,"props":2500,"children":2502},{"href":2501},"..\u002Ftriaging-live-sql-activity\u002FSKILL.md",[2503],{"type":50,"value":2504},"triaging-live-sql-activity",{"type":50,"value":2506}," - For real-time query triage",{"type":45,"tag":115,"props":2508,"children":2509},{},[2510,2514],{"type":45,"tag":87,"props":2511,"children":2512},{"href":97},[2513],{"type":50,"value":100},{"type":50,"value":2515}," - For estimating storage requirements before DDL operations",{"type":45,"tag":2517,"props":2518,"children":2519},"style",{},[2520],{"type":50,"value":2521},"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":2523,"total":2677},[2524,2541,2557,2572,2583,2593,2606,2612,2625,2640,2651,2664],{"slug":2525,"name":2525,"fn":2526,"description":2527,"org":2528,"tags":2529,"stars":2538,"repoUrl":2539,"updatedAt":2540},"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},[2530,2531,2534,2537],{"name":20,"slug":21,"type":15},{"name":2532,"slug":2533,"type":15},"Incident Response","incident-response",{"name":2535,"slug":2536,"type":15},"Kubernetes","kubernetes",{"name":17,"slug":18,"type":15},105,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fhelm-charts","2026-07-12T07:57:25.288146",{"slug":2542,"name":2542,"fn":2543,"description":2544,"org":2545,"tags":2546,"stars":2538,"repoUrl":2539,"updatedAt":2556},"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},[2547,2550,2553],{"name":2548,"slug":2549,"type":15},"Deployment","deployment",{"name":2551,"slug":2552,"type":15},"Encryption","encryption",{"name":2554,"slug":2555,"type":15},"Security","security","2026-07-12T07:56:37.675396",{"slug":2558,"name":2558,"fn":2559,"description":2560,"org":2561,"tags":2562,"stars":2538,"repoUrl":2539,"updatedAt":2571},"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},[2563,2564,2567,2568],{"name":20,"slug":21,"type":15},{"name":2565,"slug":2566,"type":15},"Debugging","debugging",{"name":2535,"slug":2536,"type":15},{"name":2569,"slug":2570,"type":15},"Migration","migration","2026-07-12T07:56:48.360871",{"slug":2573,"name":2573,"fn":2574,"description":2575,"org":2576,"tags":2577,"stars":2538,"repoUrl":2539,"updatedAt":2582},"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},[2578,2579,2580,2581],{"name":20,"slug":21,"type":15},{"name":2565,"slug":2566,"type":15},{"name":2548,"slug":2549,"type":15},{"name":2535,"slug":2536,"type":15},"2026-07-12T07:57:24.018818",{"slug":2584,"name":2584,"fn":2585,"description":2586,"org":2587,"tags":2588,"stars":2538,"repoUrl":2539,"updatedAt":2592},"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},[2589,2590,2591],{"name":20,"slug":21,"type":15},{"name":2548,"slug":2549,"type":15},{"name":2535,"slug":2536,"type":15},"2026-07-12T07:56:45.777567",{"slug":2594,"name":2594,"fn":2595,"description":2596,"org":2597,"tags":2598,"stars":2538,"repoUrl":2539,"updatedAt":2605},"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},[2599,2600,2601,2602],{"name":20,"slug":21,"type":15},{"name":2548,"slug":2549,"type":15},{"name":2535,"slug":2536,"type":15},{"name":2603,"slug":2604,"type":15},"Operations","operations","2026-07-12T07:56:47.082609",{"slug":4,"name":4,"fn":5,"description":6,"org":2607,"tags":2608,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2609,2610,2611],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"slug":100,"name":100,"fn":2613,"description":2614,"org":2615,"tags":2616,"stars":22,"repoUrl":23,"updatedAt":2624},"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},[2617,2620,2621,2622],{"name":2618,"slug":2619,"type":15},"Data Modeling","data-modeling",{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":2623,"slug":224,"type":15},"SQL","2026-07-12T07:57:22.763788",{"slug":2626,"name":2626,"fn":2627,"description":2628,"org":2629,"tags":2630,"stars":22,"repoUrl":23,"updatedAt":2639},"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},[2631,2634,2637,2638],{"name":2632,"slug":2633,"type":15},"Audit","audit",{"name":2635,"slug":2636,"type":15},"Compliance","compliance",{"name":20,"slug":21,"type":15},{"name":2554,"slug":2555,"type":15},"2026-07-18T05:48:00.862384",{"slug":2641,"name":2641,"fn":2642,"description":2643,"org":2644,"tags":2645,"stars":22,"repoUrl":23,"updatedAt":2650},"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},[2646,2647,2648,2649],{"name":2632,"slug":2633,"type":15},{"name":20,"slug":21,"type":15},{"name":2603,"slug":2604,"type":15},{"name":2554,"slug":2555,"type":15},"2026-07-12T07:57:01.506735",{"slug":2652,"name":2652,"fn":2653,"description":2654,"org":2655,"tags":2656,"stars":22,"repoUrl":23,"updatedAt":2663},"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},[2657,2658,2661,2662],{"name":2632,"slug":2633,"type":15},{"name":2659,"slug":2660,"type":15},"Data Analysis","data-analysis",{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},"2026-07-12T07:57:16.190081",{"slug":2665,"name":2665,"fn":2666,"description":2667,"org":2668,"tags":2669,"stars":22,"repoUrl":23,"updatedAt":2676},"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},[2670,2671,2674,2675],{"name":20,"slug":21,"type":15},{"name":2672,"slug":2673,"type":15},"Engineering","engineering",{"name":13,"slug":14,"type":15},{"name":2623,"slug":224,"type":15},"2026-07-12T07:57:26.543278",40,{"items":2679,"total":2731},[2680,2686,2693,2700,2707,2714,2721],{"slug":4,"name":4,"fn":5,"description":6,"org":2681,"tags":2682,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2683,2684,2685],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"slug":100,"name":100,"fn":2613,"description":2614,"org":2687,"tags":2688,"stars":22,"repoUrl":23,"updatedAt":2624},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2689,2690,2691,2692],{"name":2618,"slug":2619,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":2623,"slug":224,"type":15},{"slug":2626,"name":2626,"fn":2627,"description":2628,"org":2694,"tags":2695,"stars":22,"repoUrl":23,"updatedAt":2639},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2696,2697,2698,2699],{"name":2632,"slug":2633,"type":15},{"name":2635,"slug":2636,"type":15},{"name":20,"slug":21,"type":15},{"name":2554,"slug":2555,"type":15},{"slug":2641,"name":2641,"fn":2642,"description":2643,"org":2701,"tags":2702,"stars":22,"repoUrl":23,"updatedAt":2650},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2703,2704,2705,2706],{"name":2632,"slug":2633,"type":15},{"name":20,"slug":21,"type":15},{"name":2603,"slug":2604,"type":15},{"name":2554,"slug":2555,"type":15},{"slug":2652,"name":2652,"fn":2653,"description":2654,"org":2708,"tags":2709,"stars":22,"repoUrl":23,"updatedAt":2663},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2710,2711,2712,2713],{"name":2632,"slug":2633,"type":15},{"name":2659,"slug":2660,"type":15},{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"slug":2665,"name":2665,"fn":2666,"description":2667,"org":2715,"tags":2716,"stars":22,"repoUrl":23,"updatedAt":2676},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2717,2718,2719,2720],{"name":20,"slug":21,"type":15},{"name":2672,"slug":2673,"type":15},{"name":13,"slug":14,"type":15},{"name":2623,"slug":224,"type":15},{"slug":2722,"name":2722,"fn":2723,"description":2724,"org":2725,"tags":2726,"stars":22,"repoUrl":23,"updatedAt":2730},"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},[2727,2728,2729],{"name":20,"slug":21,"type":15},{"name":13,"slug":14,"type":15},{"name":2623,"slug":224,"type":15},"2026-07-25T05:31:22.562808",34]