The query ran, and the data looked wrong. A missing piece. You needed a new column.
Adding a new column is one of the most common schema changes in any database. It sounds simple, but in production, it is never just an ALTER TABLE and done. Every decision—type, default values, indexing, nullability—affects performance, compatibility, and future features.
Start with the definition. Know exactly what data the new column will store. Choose the smallest data type that fits the need. Smaller types reduce storage and speed up queries. If the column should never be empty, declare it NOT NULL. If you need to set a default, pick a value that avoids confusion in downstream systems.
Check access patterns before you add an index. Indexes make lookups faster, but they also slow inserts and updates. If the new column will be filtered or joined often, index it. Otherwise, skip it until you see a real performance problem.