The query returned fast, but the result was wrong. The table needed a new column, and every second it was missing cost real work.
Adding a new column sounds simple. In production, it can be a minefield. Schema changes lock tables. Long migrations block writes. Bad defaults break queries you have not run yet. The key is to make the change without killing uptime.
Plan the schema change. Define the column name, type, and constraints before you touch the database. Use a migration tool that supports online DDL. In MySQL, pt-online-schema-change or gh-ost reduce locks. In PostgreSQL, adding a nullable column without a default is fast, but adding it with a default rewrites the table. Split the change into steps: first add the nullable column, then backfill, then set constraints.
Watch out for indexing a new column. Creating an index can be more expensive than the column itself. Use concurrent index creation where supported. Avoid creating multiple indexes in the same migration.