The query was slow. The report showed why. A missing index and a bloated table. The fix started with one thing — a new column.
Adding a new column changes the shape of your data. Whether you’re working with Postgres, MySQL, or a columnar store, the decision hits performance, storage costs, and query semantics. You must plan it.
First, define the purpose. Every column must exist for a reason. Track a metric, store a flag, or record a timestamp. Avoid dumping free-form data that will never be queried.
Second, choose the right data type. For numeric fields, pick an integer size that fits. For text, use varchar with limits or text when needed. For large data, consider compression options. Wrong types cause wasted space and slow reads.
Third, set default values or nullability rules. If old rows need values, decide how to backfill. A careless migration can lock tables for minutes or hours. Use phased updates.