The query to add a new column should be instant, but it isn’t. You’ve seen it drag through millions of rows, locking tables, risking downtime. Schema changes feel dangerous because they are.
A new column in a relational database changes the shape of your data. Whether in PostgreSQL, MySQL, or SQLite, this operation alters the metadata, adjusts default values, and can trigger costly rewrites. Engineers often debate ALTER TABLE ADD COLUMN vs. creating a shadow table—it’s more than theory. Indexes, constraints, and replication lag are real factors that can break production.
In PostgreSQL, adding a nullable column without a default is fast—it only updates the system catalog. Adding a column with a default forces a full table rewrite unless using ALTER TABLE ... ADD COLUMN ... DEFAULT ... with the SET DEFAULT method introduced in newer versions. MySQL differs: depending on the storage engine, adding a column is a full rebuild unless using ALGORITHM=INPLACE with LOCK=NONE, reducing blocking time.