Adding a new column should be fast, safe, and predictable. Yet in production databases, it can be risky. Schema changes can lock tables or cause downtime if handled blindly. The right approach depends on the database engine, the column type, and the scale of your data.
In PostgreSQL, adding a nullable column without a default is nearly instant, even on large tables. Setting a default value or making the column NOT NULL can trigger a table rewrite, which is slow. MySQL behaves differently—an ALTER TABLE often copies data, but recent versions with ALGORITHM=INPLACE or INSTANT can add columns without long locks. Knowing these details prevents outages.
When adding a new column to support new features, you need to think about indexing strategy. Adding an index upfront can slow down writes immediately. Often it’s best to add the column first, backfill it, then create indexes in a separate operation.