The migration was live, and the query hung in the air like a blade. You needed a new column. Not later. Now.
Adding a new column in a database should be direct, but the wrong approach can lock tables, slow writes, and break production. The goal is speed without risk. That means knowing your schema, your indexes, and how your database engine handles DDL.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable columns without defaults. It updates metadata, not rows. Add a default, and you trigger a rewrite. MySQL behaves differently depending on the storage engine and version. Newer MySQL with ALGORITHM=INPLACE can avoid a full table copy for certain column changes, but not all.
Always run the operation in a safe window, or use an online schema change tool. Tools like pt-online-schema-change and gh-ost let you add a new column without blocking reads and writes. On large datasets, test these in staging with production-like load before deploying.