The query returned in under a second, but the data was wrong. A missing field in the result set broke the feature in production. The fix was simple: add a new column.
A new column in a database alters both the data model and the application logic. Done right, it unlocks new capabilities. Done wrong, it creates instability and hidden costs. Whether in PostgreSQL, MySQL, or a NoSQL store, adding a column changes schema assumptions, queries, indexes, and downstream services.
Before running ALTER TABLE ADD COLUMN, confirm the impact on read/write performance. Adding a column to a large table can lock writes, block queries, and trigger costly updates. In high-traffic systems, use online schema changes or migration tools that stream alterations without downtime.
Plan for default values. If you set a default on a new column, the database might backfill existing rows, which can be slow on billions of records. Consider null defaults where possible, then backfill in batches. Update ORM models, API contracts, and serialization code in sync with the schema change to avoid runtime errors or missing data.