The database waits. You run the query. The table needs a new column.
Adding a new column should be simple, but under load, it can cripple performance. Schema changes are not just about syntax—they are about speed, safety, and uptime. Every ALTER TABLE on a production database carries risk. The goal is to add a column without blocking queries, without downtime, and without surprises.
First, choose the right migration strategy. For small tables, a normal ALTER TABLE ADD COLUMN may complete instantly. For large datasets or critical systems, use an online schema migration tool like pt-online-schema-change or gh-ost. These tools copy data into a shadow table, apply the new column, and switch over with minimal locking.
Second, decide on defaults and nullability early. Adding a NOT NULL column with a default value can trigger a full table rewrite. If performance matters, add the column as nullable, backfill in batches, then enforce constraints later.