The query was slow. The report showed millions of rows. The fix was obvious: add a new column.
A new column changes a table’s shape, but it also changes how every query touches it. Before creating one, define its purpose. Is it a computed value, a foreign key, or a flag? The wrong type wastes space. The wrong indexing kills performance. Understand the table’s distribution, data type limits, and null-handling rules before you commit.
Use ALTER TABLE with precision. For large datasets, default values can lock writes for minutes. Avoid full-table rewrites unless necessary. In modern systems, consider online schema changes. MySQL, PostgreSQL, and cloud-native databases each handle new column creation differently, with trade-offs between speed and consistency. Test on a staging copy under realistic load.