The query came back fast, but the schema didn’t match. You need a new column.
Adding a new column sounds simple. In production, it can turn into a trap if you move without a plan. Schema changes touch live data, running code, and downstream systems. One mistake can lock tables, drop queries, or block deployments.
The safest path is clear. First, check the database engine’s documentation on altering tables. MySQL, PostgreSQL, and others have different lock behaviors. Some allow adding a nullable column without blocking reads and writes. Others need careful scheduling.
Run the change in a staging environment with production data volume. Measure the migration time. Watch for index rebuilds and table rewrites. Avoid default values that trigger a rewrite on large datasets. Use nullable columns, then backfill in small batches.