Adding a new column seems trivial—until it’s not. Behind the simple ALTER TABLE statement is a set of trade-offs that can slow queries, lock rows, or even cause downtime if done at scale. Whether using PostgreSQL, MySQL, or a distributed database, the way you introduce a new column determines both stability and performance.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is fast when the column allows nulls and has no default. Adding a default value triggers a table rewrite in older versions, which can lock large datasets for long periods. Modern versions optimize this, but the choice of default still matters.
In MySQL, adding a new column can trigger a full table copy depending on the storage engine and configuration. Online DDL features mitigate this, but efficient execution requires understanding which operations are truly “instant.” For distributed databases like CockroachDB or YugabyteDB, schema changes propagate asynchronously, which can briefly yield different schemas on different nodes—impacting application logic.