The query ran fast, but the numbers didn’t match. You open the schema and see the problem: a missing field. You need a new column, and you need it without breaking production.
Adding a new column in SQL sounds simple until you deploy it at scale. Schema changes can lock tables, spike CPU, and block writes. The goal is zero downtime. That means planning migrations, indexing with intent, and rolling out changes in controlled steps.
First, define the new column with precision. Choose the smallest data type that fits the requirement. Avoid NULL defaults if possible; they can bloat storage. If you need to backfill data, run it in batches to prevent load spikes.
Second, decide if the column requires an index. New indexes help queries but cost writes and disk. Create them only after analyzing query patterns. Test on a staging database with production-sized data.