Adding a new column should be simple. In practice, the wrong approach can cripple performance. Schema changes in production databases are more than syntax—they are operations that can lock tables, block writes, and spike latency. Whether you use PostgreSQL, MySQL, or a distributed SQL system, the strategy matters.
In PostgreSQL, ALTER TABLE ADD COLUMN executes quickly if the new column has no default value. Adding a default on a large table can rewrite every row, triggering heavy I/O. For MySQL, storage engines behave differently: InnoDB can add columns online in many cases, but still risks metadata locks that block queries. For high-availability environments, you should assess the migration path before execution.
Best practice is to break the change into steps. First, add the column as nullable without a default. Then backfill in controlled batches, monitoring query plans and system load. Finally, set defaults or constraints once all rows are populated. This reduces downtime risk and preserves availability even during peak traffic.