Adding a new column is one of the most common schema changes, but it is also one of the most misunderstood. A single ALTER TABLE can trigger locks, block writes, or push production into high load. Done wrong, it risks data integrity. Done right, it’s fast, safe, and invisible to the users.
A new column changes the shape of your tables. Every index, every query plan, every row in storage is affected. In relational databases like PostgreSQL, MySQL, and SQL Server, the mechanics differ. Some engines rewrite the entire table, others only modify metadata if the column is nullable without defaults. Understanding the difference between physical and metadata-only alterations determines whether the change happens in seconds or hours.
For large datasets, adding a column with a default value can be dangerous. In PostgreSQL, this historically rewrote every row. In recent versions, defaults on NULL columns can be stored in metadata, avoiding a full rewrite. MySQL handles certain ALTER TABLE operations online with ALGORITHM=INPLACE, but not all column types qualify. SQL Server may require partition-level operations to avoid locking the entire table.