The query finished in 18 seconds, but the result was wrong. You check the schema. The cause is simple: the table is missing a new column.
Adding a new column sounds small, but it changes the shape of your data. It is a structural update that affects code, queries, and pipelines. Done right, it is fast, safe, and reversible. Done wrong, it breaks production.
In SQL, adding a new column is direct:
ALTER TABLE orders
ADD COLUMN tracking_id TEXT;
This single statement updates the schema in place. But in a live system, there is more to consider.
First, choose the correct data type. A wrong type forces casts and slows down queries. Second, decide on nullability. NOT NULL guards against missing data but fails on existing rows without defaults. Third, think about the write path. Backfill only when needed, and batch updates to avoid lock contention.