Adding a new column to a database table sounds simple, but the wrong move can block queries, lock tables, or cause downtime. Performance depends on the size of the dataset, index strategy, and database engine. The safest approach is to plan the schema change for zero disruption.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is fast when the column has a NULL default. Adding a non-NULL default will rewrite the table, which can be slow for large datasets. Avoid immediate value backfills in production migrations unless you control traffic. Instead, add the column with NULL, deploy the application update, and backfill in smaller batches.
In MySQL, the rules vary by version and storage engine. With InnoDB, adding a column can be instant if it’s at the end of the table and does not require a table copy. Always confirm with ALGORITHM=INSTANT when possible. Older versions may require a full table rebuild, so be ready with replicas or maintenance windows.