Adding a new column sounds trivial. In production systems with live data, it is a high‑risk change that can wreck performance or introduce silent data loss. The wrong command at the wrong time can lock rows, block queries, and stall deployments.
A new column should never be an afterthought. Start by defining the purpose, data type, and constraints with precision. Avoid generic types when a fixed type enforces better validation. Check default values against real workloads. Nullability is not a convenience flag — it is a contract that determines data integrity.
Before altering schema in production, run a migration script in a staging environment with a realistic dataset. Measure how long the ALTER TABLE takes. For large tables, consider techniques like creating a shadow table, backfilling data in batches, and then swapping it in with a rename operation. Many relational databases, including Postgres and MySQL, have operations that look instantaneous but actually rewrite the entire table under the hood.