
Unlock this content
Enter your email to unlock this content for free
Schema Change Costs
Schema changes in ClickHouse fall into three cost categories: metadata changes (fast, cheap), table mutations (moderate cost, background processing), and full rewrites (expensive, require infrastructure). Understanding these categories helps you plan schema evolution and estimate the impact on your system.
Metadata Changes
Metadata changes are the cheapest schema operations in ClickHouse. They only modify table metadata (the schema definition) without touching the actual data on disk. ClickHouse stores metadata separately from data, allowing these changes to execute in milliseconds with minimal resource usage.
Adding columns:
ALTER TABLE events ADD COLUMN tenant_id String DEFAULT '';Existing rows use the default value (computed on read), and new inserts can provide values or use the default. No data is rewritten.
Renaming columns: