Adding a new column should be fast, predictable, and safe — whether you’re working with PostgreSQL, MySQL, or a distributed SQL system. Yet schema changes often carry risk: blocking writes, locking rows, or breaking downstream tooling. The goal is simple: add the column without slowing production traffic or triggering failures.
In relational databases, a new column alters the table definition stored in system catalogs. For small tables, this is nearly instant. For large datasets, physical changes to stored rows can cause long migrations. On PostgreSQL, adding a nullable column with no default is usually a metadata-only operation. Adding a column with a default that is not NULL forces a rewrite of the entire table. On MySQL, ALTER TABLE can lock tables depending on engine and version. In distributed SQL — like CockroachDB or YugabyteDB — schema changes can be online but must coordinate across nodes.
Best practices for adding a new column: