The query had been running for months without change, until the business team dropped a single request: add a new column.
In most systems, adding a new column sounds simple. It is not. Doing it wrong risks downtime, broken data, and angry users. Doing it right requires control, speed, and zero surprises. Every database, from PostgreSQL to MySQL to modern distributed stores, has its own behavior when a schema changes. Some lock tables. Some rewrite data. Some require full migrations that block writes.
The first step is understanding the risk. A new column with a default value on a massive table can trigger a full re‑write. That kills performance. On live systems, you need an approach that avoids locking and batch updates in production. Tools like ALTER TABLE ... ADD COLUMN work best when you add the column as nullable, backfill in safe chunks, and then add constraints later.