Adding a new column should be simple, but in production it is a high‑risk operation. Schema changes can lock tables, block queries, and slow down deployments. The key is to choose the right method based on the size of the table, the database engine, and the uptime requirements.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for empty columns with defaults set to NULL. Adding a column with a non‑null default rewrites the whole table, which can cause downtime. MySQL has similar behavior, but with version‑specific optimizations like INSTANT for certain column types.
When the new column needs to be populated during creation, batch backfilling is safer than a single massive update. Breaking the update into chunks reduces lock times and keeps the database responsive. If foreign keys are involved, plan indexes in advance to prevent full‑table scans.