Adding a new column is one of the most common database schema changes. Done wrong, it can lock tables, block writes, and stall your app. Done right, it is fast, safe, and transparent to users.
Before you add a column, decide on the column name, data type, and default value. In PostgreSQL, adding a nullable column is instant because it only updates metadata. Adding a column with a default value on a large table can trigger a full rewrite. If you need a default, set it in a separate update step to avoid long locks.
In MySQL, behavior depends on storage engine and version. Some versions handle ALTER TABLE ADD COLUMN as a copy operation for large datasets. Using ALGORITHM=INPLACE or ALGORITHM=INSTANT (when available) can cut changes from hours to milliseconds. Always check your database’s documentation and confirm with a test migration.