Adding a new column is one of the most common schema changes. Yet it is also one of the easiest to get wrong at scale. The wrong approach can lock tables, cause downtime, or slow queries for hours. Done right, it unlocks new features without interrupting production traffic.
The first rule is to understand the current size and usage of the table. On small tables, ALTER TABLE ADD COLUMN may finish instantly. On large, heavily used tables, that same command can trigger a long lock, blocking reads and writes. Modern databases like PostgreSQL, MySQL, and others offer ways to add a new column without full-table rewrites. For example, adding a nullable column with no default in PostgreSQL is a metadata-only change.
The second rule is to plan defaults and constraints later, not during the initial ADD COLUMN step. Adding a non-nullable column with a default forces the database to write to every row, multiplying execution time. Instead, add the column as nullable, backfill the data in controlled batches, then set constraints.