Adding a new column should be fast, safe, and free of side effects. In many systems, it is not. Schema changes can lock tables, block writes, or trigger costly migrations. On production databases, that risk compounds. The right strategy for adding a new column starts with understanding your database engine, table size, and workload patterns.
In MySQL, ALTER TABLE can be instant for certain column additions, but adding a NOT NULL without a default will rewrite the table. PostgreSQL allows adding a nullable column with a default instantly in recent versions, but older versions rewrite. With large datasets, that rewrite can take minutes or hours, locking writes and slowing queries.
A safe workflow is to add the column as nullable, backfill in small batches, then enforce constraints. This reduces downtime and operational risk. Tools like pt-online-schema-change, gh-ost, and native online DDL features make it possible to add columns without blocking traffic. Test the migration in a staging environment with production-like data to measure impact before deploying.