The query returned in under 50 milliseconds, but the schema had changed. A new column had appeared.
When adding a new column to a database, precision matters more than speed. Every choice—name, type, constraints—carries forward into every query, migration, and integration. A poorly planned column pollutes data models, slows performance, and creates technical debt. A well-planned one becomes invisible, doing its job without friction for years.
Start with the data type. Match it to the real-world shape of the data. Avoid overwide types that waste memory or underwide ones that cut off valid values. Define constraints early. NOT NULL and CHECK constraints enforce correctness at the source. Indexed columns can transform query speed, but each index has a write cost—measure and trade off.
Version control every schema change. In environments with continuous deployment, treat migrations as code. Make them idempotent, test on staging, and tag releases. Never run a destructive ALTER TABLE without a backup and rollback plan. When adding a new column to large production tables, use online schema change tools to avoid locking reads and writes.