The table was too slow. You knew why the moment you saw the schema. No indexes could save it. The solution was clear: add a new column.
A new column changes the shape of your data. It can cut query time from seconds to milliseconds. It can hold derived values to avoid expensive joins. It can store flags that drive application logic. Done well, a new column makes systems faster, cleaner, easier to maintain. Done wrong, it can become technical debt that bleeds time and money.
Before adding a new column, define its purpose with precision. Decide the type: integer, boolean, text, timestamptz. Pick defaults that work for both existing and future rows. Plan for nullability — forcing NOT NULL on old data can lock writes and block production. Consider constraints and indexes at creation time to avoid later locking costs.
In PostgreSQL, using ALTER TABLE ... ADD COLUMN is straightforward, but understanding the lock it takes matters. Adding a nullable column without a default is instant. Adding one with a default rewrites the table, which may block. In MySQL, similar operations can be fast or painful depending on storage engine and table size. With big datasets, test on a staging copy before altering production.