The table was wrong. Data missed the mark. A new column would fix it. You knew it before the query even ran. Schema changes are the quiet way to move fast without breaking what matters.
Adding a new column sounds simple. In reality, it forces a choice: block writes until the schema updates, or perform the change in a way that scales under production load. On small datasets, an ALTER TABLE ADD COLUMN might finish in milliseconds. On terabytes of rows in a high-traffic system, it can lock the table, spike latency, and trigger timeouts.
Plan before you alter. Choose the column name with precision. Avoid reserved words. Decide the data type now, not later. Consider nullability. Adding a non-null column with no default will fail unless every row satisfies the constraint. Adding it with a default forces a table rewrite in some databases. If you must set defaults, do it in a second step after the column exists.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is transactional and fast for nullable columns without defaults. In MySQL, the same statement can rewrite the entire table. On modern cloud-native databases, online DDL operations can add a new column without blocking reads and writes. Know your engine’s behavior before you change production.