Adding a new column is one of the most common schema changes. It is also one of the most disruptive if done without care. A single mistake can lock queries, slow writes, or break production code. The right approach keeps performance intact and downtime at zero.
First, understand the default behavior. In many relational databases, ALTER TABLE ADD COLUMN is metadata-only when you add a nullable column without a default. This executes fast because the database doesn’t rewrite existing rows. But when you add a column with a default value that is not NULL, some systems rewrite the entire table on disk. At scale, this can block transactions for minutes or hours.
To avoid this, add the column as nullable, then populate it in batches. Use indexed updates if queries on the new column will be frequent. Only after the data is ready should you apply constraints or defaults. This sequence turns a high-risk migration into a safe one.