The codebase needs a new column, and the deadline isn’t moving. You open the migration file, fingers on the keys, already mapping the impact. Adding a column sounds small, but in production, every schema change is a loaded gun.
A new column changes storage. It changes queries. It changes indexes. Done carelessly, it can trigger table locks, block writes, and burn CPU cycles in unexpected ways. Done right, it extends functionality without slowing a single request.
When adding a new column, start with the data type. Choose the smallest type that fits your future plans. A bloated type forces the database to store more data and scan more pages. Keep it tight. Next, set sensible defaults. If the application needs a value for every row, define it now to avoid NULL checks in every query.