The query hit the database, but something was missing. A new column had to be added, and production could not wait.
Adding a new column to a live database table sounds simple. It is not. Schema changes touch data integrity, write performance, replication lag, and deployment risk. Done wrong, a single ALTER TABLE blocks queries, locks rows, and triggers downtime. Done right, a new column extends capability without breaking anything.
Start by identifying how the new column will be used. Define its data type, default value, nullability, and indexing strategy. Every choice affects storage, query cost, and migration complexity. Avoid adding columns without constraints or clear purpose.
For relational databases like PostgreSQL and MySQL, review version-specific behavior. Some support instant column addition with metadata-only changes. Others rewrite the entire table. On large datasets, use online schema change tools such as gh-ost or pt-online-schema-change to avoid blocking writes.