The query returned in under a second, but the schema had changed, and your dataset broke. You needed a new column.
Adding a new column should be simple. In production, it can become a risk. Schema changes touch live data. Migrations can lock tables, block writes, or degrade performance. Each choice—data type, default value, nullability—affects speed, storage, and integrity.
Before creating a new column, confirm the size and type match your expected range. Use lightweight types where possible. Avoid premature indexing; measure first. If the column requires a default value, set it carefully to avoid full-table rewrites on large datasets. On writes, nullable columns reduce risk during rollout.
For zero-downtime migrations, run additive changes in multiple steps. First, add the column as nullable with no default. Deploy the application code that writes to it. Backfill data in controlled batches. Then enforce constraints or defaults once data is complete. This approach prevents locking and preserves throughput.