The query returned fast. The table was clean. But the requirement changed, and the schema now needed a new column.
Adding a new column sounds simple, but the details define success. You need to choose the right data type. You need to know how it will be indexed. You need to keep production steady while the migration rolls out.
In SQL, adding a column is done with ALTER TABLE. This can be an instant operation for small datasets but heavy for large ones. For massive tables, even a single new column can lock rows, block writes, or strain replicas. Plan for zero-downtime migrations by staging changes in smaller batches or using tools that handle online schema changes.
Consider the default value before deployment. Large backfills can spike disk usage. Setting a default in the schema will write the value for every existing row, which may cause delays. In some cases, adding a nullable column first, then updating it in controlled steps, is safer.