What you needed was a new column.
A new column changes the shape of your data. It can unlock indexes, enable joins, and remove the need for costly transformations. It’s the smallest structural change that can have the largest performance gain. But done wrong, it can crush your database under downtime or lock contention.
Before adding a new column, define exactly what belongs in it. Choose the correct data type—narrow widths save space, speed queries, and reduce I/O. Use NULL defaults when possible to avoid full-table rewrites in production. In systems like PostgreSQL, adding a new column with a constant default rewriting every row can cripple throughput. Use lightweight defaults or adjust the migration code to backfill in smaller batches.
Think about indexing early. A non-nullable, frequently queried new column is a candidate for indexing, but only after it’s populated. Adding the index at the wrong moment can double your migration time. In MySQL or MariaDB, adding a new column may require a table lock unless you use an engine that supports instant DDL.