The table was failing. Reports timed out, indexes groaned, and you knew what had to be done: add a new column.
A new column is one of the most common schema changes in production databases. It sounds simple. It isn’t. The way you design, deploy, and index that column can decide if your system stays online or collapses under load.
Before creating a new column, define its data type with precision. Avoid using oversized types like TEXT when a VARCHAR(255) is enough. For numeric fields, pick the smallest integer or decimal type that fits the range. Smaller columns mean smaller indexes, faster queries, less I/O.
Decide on nullability. Making a new column NOT NULL with a default value can lock and rewrite entire tables in relational databases like MySQL or PostgreSQL. On large datasets, this can cause hours of blocking writes. If you need values for existing rows, populate them in controlled batches instead of all at once.
For indexed new columns, remember that adding an index during peak traffic can overload your system. Create the column first, then backfill data, then add the index online using the database’s native tools (CONCURRENTLY in PostgreSQL, ALGORITHM=INPLACE or ONLINE in MySQL).