The query returned fast, but the structure was wrong. You checked the schema and saw the problem. There was data missing, and the table needed a new column. Not tomorrow. Now.
Adding a new column should be a surgical operation. Done right, it does not block writes, lock tables, or break production. Done wrong, it can trigger downtime, deadlocks, and corrupted data. Modern systems demand zero-interruption schema changes. The way to achieve this is to plan the migration, execute it in stages, and isolate the risk.
Define the column with the correct type and constraints. Choose defaults carefully; large tables can suffer if you backfill inline. Use background migrations or batch jobs to populate the new column without locking. Validate after each step with precise queries and checksums. When deploying, feature flag the new column’s usage so you can roll back without altering the schema again.