Adding a new column is one of the most common schema changes in any database. It looks simple, but the wrong approach can lock tables, slow queries, or break applications. Whether your database is PostgreSQL, MySQL, or a distributed system, execution matters.
A new column should be planned with type, default value, and nullability in mind. In PostgreSQL, adding a nullable column without a default is fast since it doesn’t rewrite existing rows. Adding a column with a default value, however, can trigger a full table rewrite unless done with newer syntax. MySQL can handle similar changes online with ALGORITHM=INPLACE, but older versions may lock writes.
For production systems, the safest method is to add the column in a way that avoids downtime. Add it as nullable, backfill in small batches, then apply constraints. This staged migration keeps read and write availability intact. Always verify indexes, since adding them alongside a new column can compound performance hits.