The table was slow, and the backlog kept growing. You knew the fix was small: add a new column.
A new column in a database changes everything. It can store critical state, enable fresh queries, or unlock a feature. But creating one is never just adding ALTER TABLE. Done wrong, it locks writes, triggers reindexing, or causes application errors. Done right, it’s fast, safe, and invisible to users until you flip the switch.
When adding a new column in PostgreSQL, choices matter. Use ADD COLUMN with a default only if the table is small. For millions of rows, first add it as nullable, then backfill in batches, then add constraints. MySQL behaves differently; always check for table locking during schema changes. In distributed databases, schema drift between nodes will break deploys—coordinate migrations tightly.