The query is slow. You trace it back to a missing field. You need a new column.
Adding a new column sounds trivial until you weigh the trade-offs. Schema migrations lock tables. Downtime bleeds through deployments. Large datasets turn a small change into a performance event. Each decision—data type, default value, indexing—can alter latency, query plans, and scalability for years.
Before creating the column, define the purpose. Is it storing raw data, a computed value, or a foreign key? For text fields, choose fixed or variable length wisely; for numbers, select the smallest type that fits future growth. Avoid nullable fields unless there’s a strong reason—they increase complexity in queries and indexes.
Plan your migration strategy. For smaller tables, an immediate schema change is fine. For large, high-traffic tables, use online migrations. Tools like pt-online-schema-change or native database features can add a column without locking reads and writes. Always test migrations on production-like data to identify performance impact.