analyzing-schema-change-storage-risk

Analyze per-index range sizes with SHOW RANGES WITH DETAILS to estimate storage risk for CockroachDB schema changes.

3|3|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/cockroachdb/claude-plugin --skill analyzing-schema-change-storage-risk-cockroachdb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyzing-schema-change-storage-risk
Source: https://github.com/cockroachdb/claude-plugin/tree/main/skills/observability-and-diagnostics/analyzing-schema-change-storage-risk
Command: npx skills add https://github.com/cockroachdb/claude-plugin --skill analyzing-schema-change-storage-risk-cockroachdb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Estimates storage requirements for CockroachDB schema change backfills by analyzing per-index range sizes using SHOW RANGES WITH DETAILS and applying the 3× free space rule. Use when planning CREATE INDEX, ADD COLUMN, or ALTER PRIMARY KEY operations on large tables to avoid disk exhaustion during backfill.

Core Features & Use Cases

  • Per-index largest-range analysis to determine worst-case storage needs for online schema changes.
  • 3× and 4× safety margins guidance for production planning and risk assessment.
  • Capacity checks against cluster storage status and guardrails for safety during backfill.

Quick Start

Run targeted SHOW RANGES queries on a specific table to identify largest ranges, multiply by 3–4× to estimate required free space, then compare to cluster free space and proceed with DDL only when safe.

Frequently Asked Questions about analyzing-schema-change-storage-risk

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

FAQPage Schema
How do I calculate storage requirements for a CockroachDB online schema change?

Calculate CockroachDB schema change storage by analyzing per-index range sizes with SHOW RANGES WITH DETAILS, then multiplying the largest range by 3× to 5× to estimate required free space for the backfill operation.

What is the 3x free space rule for database backfills?

The 3× free space rule ensures safe CockroachDB schema changes by requiring cluster nodes to have at least three times the size of the largest table range available in free disk space before initiating an online backfill operation.

How do I check if my cluster has enough capacity for an ADD COLUMN operation?

Check cluster capacity for a CockroachDB ADD COLUMN operation by comparing the largest-range storage requirement against the minimum free space available across all nodes to determine if production-safe conditions are met.

When should I defer a CREATE INDEX backfill on a large table?

Defer a CockroachDB CREATE INDEX backfill when the minimum free space across cluster nodes is less than the largest-range requirement multiplied by the recommended 3×, 4×, or 5× safety margin, indicating an unsafe production condition.

What safety multiplier should I use for an ALTER PRIMARY KEY operation?

Use a 3× safety multiplier for standard CockroachDB ALTER PRIMARY KEY operations, but apply 4× or 5× margins depending on risk assessment and capacity planning needs to ensure sufficient free space during the backfill process.