The query returned sixteen million rows, but the new column was still missing.
Adding a new column should be fast, predictable, and safe—whether you run on Postgres, MySQL, or a cloud-managed database. Yet schema changes often trigger downtime, lock tables, or corrupt indexes when handled poorly. The key is knowing how your database handles DDL operations, and planning changes that scale without interrupting live traffic.
A new column in SQL is defined using ALTER TABLE. In simple cases, it's near-instant. But if the table is large, the operation can lock writes and slow reads. On some engines, adding a column with a default value rewrites the entire table—a costly move in production. This is why modern migration strategies avoid unnecessary rewrites, adding nullable fields first, then updating data in batches.
For Postgres, ALTER TABLE ... ADD COLUMN with a DEFAULT and NOT NULL will rewrite the table. Dropping the default after creation can avoid this. In MySQL, ALTER TABLE operations can be online or offline depending on storage engine and version; always check ALGORITHM=INPLACE or ALGORITHM=INSTANT where supported.