The table was ready, but the data didn’t fit. You needed one more field. A new column.
Adding a new column sounds simple. In small datasets, it is. In production systems with billions of rows, the decision is heavier. Schema changes can block writes, lock reads, and slow queries. Without a plan, you risk downtime, data loss, or corrupted indexes.
The first step is to define the purpose of the new column. Is it computed, nullable, or indexed? Each choice affects storage and performance. A nullable column avoids rewriting old rows. A generated column can save computation at query time but costs more on insert.
When altering a table, use online schema change tools when possible. MySQL users might choose gh-ost or pt-online-schema-change. PostgreSQL offers ALTER TABLE ... ADD COLUMN instantly for nullable columns without DEFAULT, but adding a NOT NULL with default still rewrites the table. Planning these details reduces operational risk.