Adding a new column to a live production table is a small change with big consequences. Schema changes impact read and write performance. They can lock tables, block queries, and cascade through dependent services. Doing it wrong causes downtime. Doing it right keeps the system fast and stable.
When you add a new column in SQL—whether on PostgreSQL, MySQL, or another relational database—you need to consider type, default values, nullability, indexing, and constraints. Each choice affects storage, query planning, and replication behavior. A default value on a large table may trigger a full rewrite. Setting NOT NULL without a default can break inserts. An extra index can speed queries but slow writes.
Zero-downtime migrations depend on how you structure the change. For large datasets, add the column first without defaults or NOT NULL constraints. Populate it in small batches to avoid long locks. Then enforce constraints in a later migration. For heavily trafficked systems, feature-flag new code paths until the column is ready.