When data models change, speed matters. Adding a new column can expand capability, improve search performance, or unlock a feature. But the wrong approach can cause downtime, lock tables, or break downstream services.
A new column in SQL is more than a schema update. It can shift data flows, change indexes, and impact queries at scale. Whether you use PostgreSQL, MySQL, or a distributed datastore, you must plan the type, default values, and nullability before execution.
In PostgreSQL, ALTER TABLE ... ADD COLUMN adds a column without rewriting the whole table if no default is set. But adding a default value in the same step will rewrite data, which can block writes. Split it into two operations: first, add the column as nullable. Second, update rows in batches. Finally, set the default and constraints.
In MySQL, ALTER TABLE often rebuilds the table. This can lock it for the duration unless you use online DDL or a storage engine with instant add column support. Even then, test on realistic datasets before applying in production.