The query returned fast, but the dashboard still showed the old schema. A missing column in production can slow down deployments, break integrations, and cause costly downtime. Adding a new column sounds simple, but the wrong approach locks tables, blocks writes, or forces an outage window.
A new column in SQL is not just schema decoration. It changes how data is stored, indexed, and retrieved. On large datasets, a naive ALTER TABLE ADD COLUMN can trigger a full table rewrite. Some RDBMS engines block reads or writes during this operation. Others allow concurrent changes but degrade performance until the alteration completes. Understanding these details is the difference between smooth migrations and midnight emergencies.
For PostgreSQL, adding a nullable column without a default is fast and lock-free. Adding it with a default rewrites the table. Engineers avoid this by first adding the column as nullable, then updating rows in batches, and finally setting the default and NOT NULL constraint. In MySQL, even adding a nullable column can cause a full copy unless you are using newer versions and online DDL options.