The table was fast, but it wasn’t enough. You needed a new column, and you needed it now. The migration couldn’t wait for a maintenance window. The data had to stay live. The queries had to keep running.
Adding a new column is one of the most common schema changes in modern applications. When done wrong, it blocks writes, locks tables, and slows everything down. Done right, it is instant, non-blocking, and invisible to your users. The difference comes down to how you design and execute the change.
A well-planned new column starts with a precise definition. Choose the correct data type, apply constraints only when safe, and set default values with care. In systems like PostgreSQL, adding a nullable column without a default is fast. Adding a column with a default and backfilling existing rows in a single statement can lock up production. Break that work apart: create the column, backfill in batches, then apply constraints.