Adding a new column to a production database sounds simple. It isn’t. Schema changes can lock tables, block writes, and stall systems under load. The key is knowing the right operation for the right database engine.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable fields without a default. Add a default and it rewrites the table, which can hurt large datasets. MySQL behaves differently. With InnoDB, adding a column can require a full table copy, depending on the version and configuration. In distributed systems like CockroachDB, adding a column is a schema-change process with its own performance profile.
Plan the migration. Create the new column as nullable. Backfill rows in small batches to avoid long locks. Once data is populated, drop the nullable setting and enforce constraints. For frequently accessed tables, run performance tests in staging before production changes. Monitor query plans after deployment to catch regressions caused by new indexes or joins.