The query was fast, but the schema was wrong. You needed a new column, and the clock was ticking.
A new column changes the shape of your data. It adds structure, context, and power to every query you run afterward. Done well, it’s a small migration with big impact. Done poorly, it bleeds performance and breaks downstream code. That’s why adding a new column should be deliberate, predictable, and automated wherever possible.
First, define the column precisely—data type, nullability, default values. For relational databases, remember the cost of altering large tables. On production systems, an ALTER TABLE can lock writes and cause real downtime. Avoid this by backfilling in batches or using tools that handle online schema changes. In PostgreSQL, use ADD COLUMN with a default only if it won’t rewrite the entire table; otherwise, add it without a default, backfill manually, then set the default.