analyzing-schema-change-storage-risk

Estimate CockroachDB schema change storage needs using per-index range sizes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Estimates storage requirements for CockroachDB online schema changes by analyzing per-index range sizes and applying the 3× free-space rule to prevent mid-backfill disk exhaustion.

Core Features & Use Cases

  • Per-index storage estimation using SHOW RANGES WITH DETAILS to determine largest range sizes and apply 3×/4× safety margins.
  • Targeted capacity planning for CREATE INDEX, ADD COLUMN, and ALTER PRIMARY KEY operations on large tables.
  • Production-ready guardrails with prerequisites, monitoring guidance, and risk assessment to avoid disk exhaustion during backfills.

Quick Start

Target a large table and run the safety checks to determine if you have sufficient space before a schema change.

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 estimate storage requirements for CockroachDB schema changes?

Estimate CockroachDB schema change storage by analyzing per-index range sizes using SHOW RANGES WITH DETAILS, then applying a 3× free-space rule to prevent mid-backfill disk exhaustion during operations.

Why does a CockroachDB backfill run out of disk space during an ADD COLUMN operation?

A CockroachDB backfill causes disk exhaustion when adding columns because the operation temporarily requires multiple times the largest range size in additional storage, necessitating a conservative 4× to 5× safety buffer.

What privileges do I need to check storage capacity before a CockroachDB schema change?

Checking storage capacity for a CockroachDB schema change requires admin or ZONECONFIG privileges to execute the necessary safety checks and analyze range details using the LIMIT clause.

How much free space is required for a CREATE INDEX backfill on large CockroachDB tables?

A CREATE INDEX backfill on large CockroachDB tables requires applying a 3× free-space rule based on per-index range sizes, escalating to a 4× safety buffer for production environments to avoid disk exhaustion.

Can I plan capacity for an ALTER PRIMARY KEY operation without running out of disk space?

Plan capacity for an ALTER PRIMARY KEY operation by analyzing per-index range sizes and enforcing a 5× safety margin, ensuring sufficient disk space to complete the backfill without exhausting storage.

What are the limitations of estimating schema change storage using range sizes?

Estimating schema change storage using range sizes requires applying LIMIT usage to SHOW RANGES WITH DETAILS queries on large tables, with limitations including the need for conservative 4× safety buffers to handle unpredictable production data distribution.