The query returned fast, but the schema had changed. There was a new column.
This is the moment many projects break. A single change in a database table can force hours of refactoring, migrations, and testing. If the new column is not handled with precision, it can cause silent data corruption or feature failures that emerge weeks later.
When adding a new column, you must define its purpose, type, and constraints before writing a single line of code. Decide if it should allow null values or require defaults. Evaluate the impact on indexes, query performance, and replication lag. Check foreign keys and dependencies. Small oversights here become expensive bugs later.
Backfill data in controlled batches to avoid locking the table or overwhelming system resources. For high-traffic systems, deploy schema changes in stages: add the column first, backfill asynchronously, then flip application logic to use it. This phased approach reduces downtime and minimizes rollback complexity.