The query finished, but the feature request wasn’t in the spec. It needed a new column.
Adding a new column should be fast, safe, and versioned. Too often, it’s a slow migration that locks tables, drops connections, and stalls deploys. In high‑scale apps, schema changes must happen without downtime. The design matters before the first ALTER TABLE runs.
A new column can be nullable, defaulted, or computed. Nullable columns avoid immediate data backfill. Defaults give predictable values for new rows. Computed columns save CPU on reads but can lock writes during creation, depending on the database engine. Choosing the right type, constraint, and indexing approach reduces risk.
In PostgreSQL, ADD COLUMN is generally instant for nullable fields without defaults. A default triggers a table rewrite prior to 11, so version awareness is key. In MySQL, adding a column often copies the whole table unless using ALGORITHM=INPLACE or ALGORITHM=INSTANT in newer versions. For distributed databases, schema change protocols differ — some perform rolling schema upgrades node by node.