Adding a new column is one of the most common schema changes—and one of the most dangerous if handled poorly. On production systems, the wrong migration can lock tables, spike latency, and trigger timeouts. Understanding the impact of a new column before you deploy is critical.
Modern relational databases like PostgreSQL and MySQL offer multiple ways to add a column. A simple ALTER TABLE ... ADD COLUMN works for small datasets, but scales poorly. Large tables often require online schema changes to avoid downtime. Tools like pt-online-schema-change or gh-ost can add a new column without blocking writes, but they come with operational trade-offs.
Choosing the right column type matters. Adding a nullable column is usually faster than adding one with a default value that must be written to every row. In PostgreSQL, adding a column with a constant default can be instantaneous for newer versions, while older versions rewrite the entire table. Avoid unnecessary indexes until after the column is in place; index creation can be more expensive than the column addition itself.