analyzing-range-distribution

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Analyzing Range Distribution

范围分布分析

Analyzes 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.
Complement to profiling skills: This skill analyzes range-level data distribution; for query performance patterns, see profiling-statement-fingerprints. For schema change storage planning, see analyzing-schema-change-storage-risk.
使用
SHOW RANGES
SHOW ZONE CONFIGURATIONS
命令分析CockroachDB的范围分布、leaseholder位置以及区域配置合规性。可识别范围数量异常、大小失衡、leaseholder热点及副本问题——全程通过SQL操作,无需访问DB Console。
与性能分析技能互补: 本技能分析范围级数据分布;如需查询性能模式,请查看profiling-statement-fingerprints。如需进行 schema 变更存储规划,请查看analyzing-schema-change-storage-risk

When to Use This Skill

适用场景

  • Identify tables/indexes with excessive range counts indicating fragmentation
  • Detect range size imbalances or uneven data distribution across nodes
  • Investigate leaseholder concentration causing read hotspots
  • Validate zone configuration effects on range placement and replica distribution
  • Diagnose range-level replication issues (under-replicated or unavailable ranges)
  • Analyze range split patterns from high write volume
  • SQL-only range analysis without DB Console access
For schema change planning: Use analyzing-schema-change-storage-risk to estimate storage requirements before CREATE INDEX or ADD COLUMN operations.
  • 识别范围数量过多、存在碎片化的表/索引
  • 检测节点间范围大小失衡或数据分布不均问题
  • 排查因leaseholder集中导致的读热点
  • 验证区域配置对范围放置和副本分布的影响
  • 诊断范围级副本问题(副本不足或不可用)
  • 分析高写入量引发的范围拆分模式
  • 在无法访问DB Console时,仅通过SQL进行范围分析
schema变更规划建议: 在执行CREATE INDEX或ADD COLUMN操作前,使用analyzing-schema-change-storage-risk估算存储需求。

Prerequisites

前置条件

  • SQL connection to CockroachDB cluster
  • Admin role OR
    ZONECONFIG
    system privilege
  • Understanding of CockroachDB range architecture (64MB default max size)
  • Knowledge of cluster topology (node IDs, regions, availability zones)
Check your privileges:
sql
SHOW GRANTS ON SYSTEM FOR current_user;  -- Should show admin or ZONECONFIG
See permissions reference for RBAC setup.
  • 与CockroachDB集群的SQL连接
  • Admin角色或
    ZONECONFIG
    系统权限
  • 了解CockroachDB范围架构(默认最大大小64MB)
  • 熟悉集群拓扑(节点ID、区域、可用区)
检查权限:
sql
SHOW GRANTS ON SYSTEM FOR current_user;  -- 应显示admin或ZONECONFIG权限
查看权限参考文档了解RBAC配置方法。

Core Concepts

核心概念

Ranges: Units of Data Distribution

范围:数据分布的基本单元

Range: Contiguous key space segment (default 64MB max size, configurable via zone config
range_max_bytes
) Raft group: Each range replicated across nodes (default 3 replicas) Leaseholder: Single replica handling reads and coordinating writes for a range
Critical: Ranges split automatically at 64MB by default, but can fragment further due to load-based splitting during high write traffic.
Range(范围): 连续的键空间段(默认最大大小64MB,可通过区域配置
range_max_bytes
调整) Raft组: 每个范围在多个节点间复制(默认3个副本) Leaseholder(租约持有者): 单个副本负责处理范围的读请求并协调写请求
关键提示: 默认情况下,范围达到64MB会自动拆分,但在高写入流量期间,基于负载的拆分可能导致范围进一步碎片化。

Leaseholders and Hotspots

Leaseholder与热点

Leaseholder concentration: Single node holding disproportionate leaseholders = read hotspot Load-based splitting: CockroachDB splits ranges experiencing high QPS, increasing range count Hotspot symptoms: High CPU on single node, slow reads on specific table/index
Leaseholder集中: 单个节点持有过多leaseholder会导致读热点 基于负载的拆分: CockroachDB会对高QPS的范围进行拆分,增加范围数量 热点症状: 单个节点CPU使用率高、特定表/索引的读请求缓慢

Range Fragmentation

范围碎片化

Fragmentation: Excessive range splits creating many small ranges (overhead from Raft coordination) Causes: High write throughput, sequential inserts (timestamp-based primary keys), load-based splitting Symptoms: High range count relative to data size, increased latency from Raft overhead
Fragmentation metric: Ranges per GB (healthy: 1-15, fragmented: 50+)
碎片化: 过多的范围拆分产生大量小范围(Raft协调带来额外开销) 原因: 高写入吞吐量、顺序插入(基于时间戳的主键)、基于负载的拆分 症状: 范围数量相对于数据规模过高、Raft开销导致延迟增加
碎片化指标: 每GB数据对应的范围数(健康值:1-15,碎片化:50+)

Zone Configurations

区域配置

Zone config: Replication and placement policies for databases, tables, or indexes Replication factor: Number of replicas per range (default: 3) Constraints: Node placement rules (region, availability zone, node attributes)
Use case: Validate intended zone config matches actual range placement.
Zone config(区域配置): 针对数据库、表或索引的复制和放置策略 复制因子: 每个范围的副本数量(默认:3) 约束条件: 节点放置规则(区域、可用区、节点属性)
应用场景: 验证预期的区域配置与实际范围放置是否一致。

SHOW RANGES DETAILS Option

SHOW RANGES DETAILS选项

CRITICAL SAFETY WARNING: The
WITH DETAILS
option computes
span_stats
(range size, key counts) on-demand, causing:
  • High CPU usage from statistics computation
  • Memory overhead proportional to range count
  • Query timeouts on large tables without LIMIT
Best practice: Always use
LIMIT
with
DETAILS
, target specific tables/indexes, avoid cluster-wide scans.
重要安全警告:
WITH DETAILS
选项会按需计算
span_stats
(范围大小、键数量),可能导致:
  • CPU使用率飙升:统计计算带来的负载
  • 内存开销:与返回的范围数量成正比
  • 查询超时:对大表执行时未加LIMIT限制
最佳实践: 使用
DETAILS
时务必搭配
LIMIT
,针对特定表/索引,避免集群级扫描。

Core Diagnostic Queries

核心诊断查询

Query 1: Range Count by Table (Production-Safe)

查询1:按表统计范围数量(生产环境安全)

sql
SELECT
  table_name,
  index_name,
  COUNT(*) AS range_count
FROM [SHOW RANGES FROM TABLE your_table_name]
GROUP BY table_name, index_name
ORDER BY range_count DESC;
Interpretation: High range count (1000s) on small tables indicates fragmentation. Cross-reference with table size.
Safety: No
DETAILS
option = production-safe, minimal overhead.
sql
SELECT
  table_name,
  index_name,
  COUNT(*) AS range_count
FROM [SHOW RANGES FROM TABLE your_table_name]
GROUP BY table_name, index_name
ORDER BY range_count DESC;
解读: 小表的范围数量过高(数千个)表明存在碎片化,需结合表大小交叉验证。
安全性: 未使用
DETAILS
选项,对生产环境影响极小,可安全使用。

Query 2: Range Size Analysis (Targeted DETAILS)

查询2:范围大小分析(定向使用DETAILS)

sql
SELECT
  range_id,
  start_key,
  end_key,
  (span_stats->>'approximate_disk_bytes')::INT / 1048576 AS size_mb,
  lease_holder,
  replicas
FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]
ORDER BY (span_stats->>'approximate_disk_bytes')::INT DESC
LIMIT 50;
Interpretation: Large ranges (>64MB) indicate split lag; many small ranges (<10MB) indicate fragmentation.
CRITICAL: Always include
LIMIT
and target specific tables. Never run
SHOW RANGES WITH DETAILS
on entire database.
sql
SELECT
  range_id,
  start_key,
  end_key,
  (span_stats->>'approximate_disk_bytes')::INT / 1048576 AS size_mb,
  lease_holder,
  replicas
FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]
ORDER BY (span_stats->>'approximate_disk_bytes')::INT DESC
LIMIT 50;
解读: 大范围(>64MB)表明拆分延迟;大量小范围(<10MB)表明存在碎片化。
重要提示: 务必添加
LIMIT
并针对特定表,切勿对整个数据库执行
SHOW RANGES WITH DETAILS

Query 3: Leaseholder Distribution (Hotspot Detection)

查询3:Leaseholder分布(热点检测)

sql
SELECT
  lease_holder,
  COUNT(*) AS leaseholder_count,
  ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 2) AS percentage
FROM [SHOW RANGES FROM TABLE your_table_name]
GROUP BY lease_holder
ORDER BY leaseholder_count DESC;
Interpretation: >40% leaseholders on single node in balanced cluster = hotspot. Check if table has zone constraints favoring specific nodes.
Remediation: Use
ALTER TABLE ... CONFIGURE ZONE USING lease_preferences
to spread leaseholders.
sql
SELECT
  lease_holder,
  COUNT(*) AS leaseholder_count,
  ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 2) AS percentage
FROM [SHOW RANGES FROM TABLE your_table_name]
GROUP BY lease_holder
ORDER BY leaseholder_count DESC;
解读: 在均衡集群中,单个节点持有超过40%的leaseholder即为热点。需检查表是否存在偏向特定节点的区域约束。
修复方案: 使用
ALTER TABLE ... CONFIGURE ZONE USING lease_preferences
分散leaseholder。

Query 4: Range Replication Health Check

查询4:范围副本健康检查

sql
SELECT
  range_id,
  start_key,
  replicas,
  array_length(replicas, 1) AS replica_count,
  voting_replicas,
  array_length(voting_replicas, 1) AS voting_replica_count,
  lease_holder
FROM [SHOW RANGES FROM TABLE your_table_name]
WHERE array_length(replicas, 1) < 3  -- Under-replicated
ORDER BY range_id
LIMIT 100;
Interpretation:
replica_count < 3
= under-replicated (data loss risk). Check for node failures, decommissioning operations, or zone config mismatches.
Safety: No
DETAILS
= production-safe.
sql
SELECT
  range_id,
  start_key,
  replicas,
  array_length(replicas, 1) AS replica_count,
  voting_replicas,
  array_length(voting_replicas, 1) AS voting_replica_count,
  lease_holder
FROM [SHOW RANGES FROM TABLE your_table_name]
WHERE array_length(replicas, 1) < 3  -- 副本不足
ORDER BY range_id
LIMIT 100;
解读:
replica_count < 3
表示副本不足(存在数据丢失风险),需检查节点故障、退役操作或区域配置不匹配问题。
安全性: 未使用
DETAILS
选项,可安全用于生产环境。

Query 5: Zone Configuration Audit

查询5:区域配置审计

sql
SHOW ZONE CONFIGURATIONS;
Output columns:
  • target
    : Database, table, or index
  • raw_config_sql
    : Zone config SQL (replication factor, constraints)
Use case: Validate intended replication factor and placement constraints match expected design.
Cross-reference: Compare zone configs with Query 3 (leaseholder distribution) and Query 4 (replica health) to validate actual placement.
sql
SHOW ZONE CONFIGURATIONS;
输出列:
  • target
    :数据库、表或索引
  • raw_config_sql
    :区域配置SQL(复制因子、约束条件)
应用场景: 验证预期的复制因子和放置约束是否符合设计要求。
交叉验证: 将区域配置与查询3(Leaseholder分布)和查询4(副本健康)结果对比,验证实际放置是否符合预期。

Query 6: Fragmentation Analysis (Ranges per GB)

查询6:碎片化分析(每GB范围数)

sql
WITH range_counts AS (
  SELECT
    table_name,
    index_name,
    COUNT(*) AS range_count
  FROM [SHOW RANGES FROM TABLE your_table_name]
  GROUP BY table_name, index_name
),
table_sizes AS (
  SELECT
    table_name,
    SUM((span_stats->>'approximate_disk_bytes')::INT) / 1073741824.0 AS size_gb
  FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]
  GROUP BY table_name
)
SELECT
  rc.table_name,
  rc.index_name,
  rc.range_count,
  ts.size_gb,
  ROUND(rc.range_count / NULLIF(ts.size_gb, 0), 2) AS ranges_per_gb
FROM range_counts rc
JOIN table_sizes ts ON rc.table_name = ts.table_name
ORDER BY ranges_per_gb DESC;
Interpretation:
  • Healthy: 1-15 ranges/GB
  • Moderate fragmentation: 16-50 ranges/GB
  • Severe fragmentation: 50+ ranges/GB
CRITICAL: This query uses
DETAILS
- only run on targeted tables with known size, never cluster-wide.
Remediation: Increase
range_max_bytes
via zone config (with caution), or accept fragmentation if caused by necessary load-based splitting.
See sql-queries reference for complete query variations and guardrails.
sql
WITH range_counts AS (
  SELECT
    table_name,
    index_name,
    COUNT(*) AS range_count
  FROM [SHOW RANGES FROM TABLE your_table_name]
  GROUP BY table_name, index_name
),
table_sizes AS (
  SELECT
    table_name,
    SUM((span_stats->>'approximate_disk_bytes')::INT) / 1073741824.0 AS size_gb
  FROM [SHOW RANGES FROM TABLE your_table_name WITH DETAILS]
  GROUP BY table_name
)
SELECT
  rc.table_name,
  rc.index_name,
  rc.range_count,
  ts.size_gb,
  ROUND(rc.range_count / NULLIF(ts.size_gb, 0), 2) AS ranges_per_gb
FROM range_counts rc
JOIN table_sizes ts ON rc.table_name = ts.table_name
ORDER BY ranges_per_gb DESC;
解读:
  • 健康状态: 1-15个范围/GB
  • 中度碎片化: 16-50个范围/GB
  • 严重碎片化: 50+个范围/GB
重要提示: 本查询使用
DETAILS
选项,仅针对已知大小的特定表执行,切勿在集群级运行。
修复方案: 通过区域配置增加
range_max_bytes
(需谨慎操作),或接受因必要的负载拆分导致的碎片化。
查看SQL查询参考文档获取完整的查询变体和防护规则。

Common Workflows

常见工作流

Workflow 1: Hotspot Investigation

工作流1:热点排查

Scenario: Single node experiencing high CPU, slow reads on specific table.
Steps:
  1. Identify leaseholder concentration: Run Query 3 on suspected table
  2. Validate zone config: Run Query 5 to check lease_preferences
  3. Check for load-based splits: Run Query 1 to detect recent range fragmentation (symptom of hotspot)
  4. Remediate: Configure lease preferences to spread reads, or partition table if hotspot is on sequential key range
Example:
sql
-- Check leaseholder distribution
SELECT lease_holder, COUNT(*) FROM [SHOW RANGES FROM TABLE hot_table] GROUP BY lease_holder;

-- Validate zone config
SHOW ZONE CONFIGURATION FOR TABLE hot_table;

-- Spread leaseholders if concentrated
ALTER TABLE hot_table CONFIGURE ZONE USING lease_preferences = '[[+region=us-west]]';
场景: 单个节点CPU使用率过高,特定表的读请求缓慢。
步骤:
  1. 识别Leaseholder集中情况: 对疑似表执行查询3
  2. 验证区域配置: 执行查询5检查lease_preferences
  3. 检查基于负载的拆分: 执行查询1检测近期范围碎片化(热点的症状)
  4. 修复: 配置租约偏好以分散读请求,若热点出现在连续键范围则对表进行分区
示例:
sql
-- 检查Leaseholder分布
SELECT lease_holder, COUNT(*) FROM [SHOW RANGES FROM TABLE hot_table] GROUP BY lease_holder;

-- 验证区域配置
SHOW ZONE CONFIGURATION FOR TABLE hot_table;

-- 分散集中的Leaseholder
ALTER TABLE hot_table CONFIGURE ZONE USING lease_preferences = '[[+region=us-west]]';

Workflow 2: Zone Config Validation

工作流2:区域配置验证

Scenario: After configuring multi-region setup, validate ranges are placed according to constraints.
Steps:
  1. Review intended configs: Run Query 5 (SHOW ZONE CONFIGURATIONS)
  2. Check actual replica placement: Run Query 4 on critical tables, inspect
    replicas
    array for node IDs
  3. Map node IDs to regions: Cross-reference with
    SHOW REGIONS
    or
    crdb_internal.gossip_nodes
  4. Identify mismatches: Ranges not matching constraints indicate rebalancing in progress or misconfiguration
Example:
sql
-- Show zone config
SHOW ZONE CONFIGURATION FOR TABLE multi_region_table;

-- Check replica placement
SELECT range_id, replicas FROM [SHOW RANGES FROM TABLE multi_region_table] LIMIT 20;

-- Map node IDs to regions
SELECT node_id, locality FROM crdb_internal.gossip_nodes;
场景: 配置多区域集群后,验证范围是否按约束条件放置。
步骤:
  1. 查看预期配置: 执行查询5(SHOW ZONE CONFIGURATIONS)
  2. 检查实际副本放置: 对关键表执行查询4,查看
    replicas
    数组中的节点ID
  3. 节点ID映射至区域: 结合
    SHOW REGIONS
    crdb_internal.gossip_nodes
    进行交叉验证
  4. 识别不匹配: 范围未符合约束条件表明正在进行重平衡或配置错误
示例:
sql
-- 查看区域配置
SHOW ZONE CONFIGURATION FOR TABLE multi_region_table;

-- 检查副本放置
SELECT range_id, replicas FROM [SHOW RANGES FROM TABLE multi_region_table] LIMIT 20;

-- 节点ID映射至区域
SELECT node_id, locality FROM crdb_internal.gossip_nodes;

Workflow 3: Fragmentation Diagnosis

工作流3:碎片化诊断

Scenario: Table with high range count relative to size, experiencing latency.
Steps:
  1. Calculate ranges per GB: Run Query 6 (targeted to specific table)
  2. Check for load-based splits: Review write patterns (sequential inserts, high QPS periods)
  3. Determine if expected: Fragmentation may be intentional for load distribution
  4. Remediate if excessive: Increase
    range_max_bytes
    (with caution - larger ranges = slower splits), or investigate reducing write hotspots
CRITICAL: Never increase
range_max_bytes
above 512MB without understanding impact on split/rebalance performance.
场景: 表的范围数量相对于数据规模过高,出现延迟问题。
步骤:
  1. 计算每GB范围数: 对特定表执行查询6
  2. 检查基于负载的拆分: 查看写入模式(顺序插入、高QPS时段)
  3. 判断是否符合预期: 碎片化可能是为了负载分布而故意产生的
  4. 过度碎片化时修复: 增加
    range_max_bytes
    (需谨慎——更大范围会降低拆分/重平衡性能),或排查减少写入热点的方法
重要提示: 若未充分了解对拆分/重平衡性能的影响,切勿将
range_max_bytes
设置超过512MB。

Safety Considerations

安全注意事项

DETAILS Option Cost

DETAILS选项的开销

Resource impact:
  • CPU: Computes span statistics on-demand for each range
  • Memory: Proportional to range count returned
  • Timeout risk: High on tables with 1000s of ranges without LIMIT
Mitigation strategies:
  1. Always use LIMIT: Cap at 50-100 ranges for exploratory analysis
  2. Target specific tables: Use
    FROM TABLE table_name
    , never cluster-wide
    SHOW RANGES WITH DETAILS
  3. Use basic queries first: Run Query 1 (no DETAILS) to assess range count before using DETAILS
  4. Production timing: Run during maintenance windows or low-traffic periods
资源影响:
  • CPU: 为每个范围按需计算跨度统计数据
  • 内存: 与返回的范围数量成正比
  • 超时风险: 对包含数千个范围的表执行时未加LIMIT限制会触发超时
缓解策略:
  1. 始终使用LIMIT: 探索性分析时限制为50-100个范围
  2. 针对特定表: 使用
    FROM TABLE table_name
    ,切勿执行集群级
    SHOW RANGES WITH DETAILS
  3. 先执行基础查询: 先运行查询1(无DETAILS)评估范围数量,再使用DETAILS
  4. 选择合适时机: 在维护窗口或低流量时段执行

Privilege Safety

权限安全

Admin role: Full cluster access, use with caution in production ZONECONFIG privilege: Limited to viewing ranges and zone configs, safer for read-only analysis
Best practice: Grant
ZONECONFIG
instead of admin for range analysis operators.
See permissions reference for granting minimal privileges.
Admin角色: 拥有集群完全访问权限,生产环境中需谨慎使用 ZONECONFIG权限: 仅能查看范围和区域配置,更适合只读分析
最佳实践: 为范围分析操作人员授予
ZONECONFIG
权限而非Admin角色。
查看权限参考文档了解最小权限授予方法。

Production Impact

生产环境影响

Read-only operations: All queries are
SELECT
or
SHOW
statements with no writes.
Performance considerations:
Query TypeImpactSafe for Production?
Basic SHOW RANGESMinimal CPU, metadata-onlyYes
SHOW RANGES WITH DETAILS (targeted, LIMIT 50)Moderate CPU spikeYes (low-traffic window)
SHOW RANGES WITH DETAILS (no LIMIT)High CPU, timeout riskNO - NEVER USE
SHOW ZONE CONFIGURATIONSMinimal, metadata-onlyYes
只读操作: 所有查询均为
SELECT
SHOW
语句,无写入操作。
性能注意事项:
查询类型影响是否适用于生产环境?
基础SHOW RANGES查询CPU消耗极低,仅操作元数据
定向SHOW RANGES WITH DETAILS(LIMIT 50)CPU中度飙升是(低流量时段)
SHOW RANGES WITH DETAILS(无LIMIT)CPU消耗极高,存在超时风险否 - 禁止使用
SHOW ZONE CONFIGURATIONS影响极小,仅操作元数据

Troubleshooting

故障排查

IssueCauseFix
Permission deniedMissing admin or ZONECONFIG privilegeGrant ZONECONFIG:
GRANT SYSTEM ZONECONFIG TO user
Query timeout with DETAILSToo many ranges without LIMITAdd
LIMIT 50
, target specific table
Empty span_stats columnMissing DETAILS keywordAdd
WITH DETAILS
to SHOW RANGES
Unexpected high range countLoad-based splitting or fragmentationRun Query 6 to calculate ranges/GB, review write patterns
Leaseholder = 0 or NULLRange in transition during rebalancingNormal during cluster changes, retry query
Under-replicated rangesNode failure, decommission, zone mismatchCheck node status, validate zone config constraints
SHOW ZONE CONFIGURATIONS shows no custom configsUsing default cluster-wide configNormal if no table/database-level overrides set
问题原因解决方法
权限拒绝缺少Admin或ZONECONFIG权限授予ZONECONFIG权限:
GRANT SYSTEM ZONECONFIG TO user
使用DETAILS时查询超时未加LIMIT导致范围过多添加
LIMIT 50
,针对特定表执行
span_stats列为空缺少DETAILS关键字在SHOW RANGES后添加
WITH DETAILS
范围数量异常偏高基于负载的拆分或碎片化执行查询6计算每GB范围数,查看写入模式
Leaseholder为0或NULL范围在重平衡过程中处于过渡状态集群变更期间属于正常现象,重试查询
副本不足节点故障、节点退役、区域配置不匹配检查节点状态,验证区域配置约束
SHOW ZONE CONFIGURATIONS无自定义配置使用集群级默认配置若未设置表/数据库级覆盖配置则属于正常现象

Key Considerations

关键注意事项

  • DETAILS option: Expensive operation - always use with LIMIT and targeted scope
  • Fragmentation is sometimes intentional: Load-based splitting improves concurrency
  • Leaseholder concentration: Check zone configs (lease_preferences) before assuming hotspot
  • Range size target: Default 64MB max (not 512MB as in older versions)
  • Replication lag: Range placement may not immediately reflect zone config changes (rebalancing takes time)
  • Cross-reference queries: Combine range analysis with zone configs for complete picture
  • Node mapping: Use
    crdb_internal.gossip_nodes
    to map node IDs to regions/zones
  • DETAILS选项: 开销较高,务必搭配LIMIT并限定范围
  • 碎片化有时是故意的: 基于负载的拆分可提升并发性能
  • Leaseholder集中: 先检查区域配置(lease_preferences)再判定为热点
  • 范围大小目标: 默认最大64MB(旧版本为512MB)
  • 副本延迟: 范围放置不会立即反映区域配置变更(重平衡需要时间)
  • 交叉验证查询: 结合范围分析与区域配置获取完整视图
  • 节点映射: 使用
    crdb_internal.gossip_nodes
    将节点ID映射至区域/可用区

References

参考资料

Skill references:
  • SQL query variations and guardrails
  • RBAC and privileges setup
Official CockroachDB Documentation:
Related skills:
  • profiling-statement-fingerprints - For query performance analysis
  • triaging-live-sql-activity - For real-time query triage
  • analyzing-schema-change-storage-risk - For estimating storage requirements before DDL operations
技能参考:
  • SQL查询变体与防护规则
  • RBAC与权限配置
官方CockroachDB文档:
相关技能:
  • profiling-statement-fingerprints - 查询性能分析
  • triaging-live-sql-activity - 实时SQL问题排查
  • analyzing-schema-change-storage-risk - DDL操作前存储需求估算