Adding a new column seems simple. It isn’t. In production, a schema change can trigger a table rewrite, lock critical queries, and stall the app. Even with zero-downtime patterns, the wrong ALTER TABLE at scale will spike latency, burn CPU, and cascade into service degradation.
A new column changes your database’s shape. Before adding one, decide its type, nullability, and default value. Wrong defaults can force a full table scan. Adding a NOT NULL column without a default can block inserts. Large text or JSON fields expand row size, reducing cache efficiency.
The safest path is online schema migration. Tools like pt-online-schema-change and gh-ost create the new column in a shadow table and copy rows in batches. In PostgreSQL, adding a nullable column without a default is fast, but adding one with a default will rewrite the whole table unless you use version-specific optimizations.
Indexing the new column requires caution. Even a small index build can cause I/O spikes in large datasets. Consider creating the index concurrently or splitting the deployment into separate steps: schema change first, index later.