The query returned in 200 milliseconds. The log showed an empty field—no value where there should be one. The fix was clear: add a new column.
A new column changes the shape of your data. It adds structure, creates space for new logic, and makes future queries faster or simpler. In SQL, adding a new column is direct:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP;
This operation extends the schema instantly for all rows. But in production, the details matter. Choose a column name that fits your naming convention. Select the right data type—wrong choices here lead to migrations later. Set NULL or NOT NULL with intent. Consider default values to maintain consistency for old rows.
In PostgreSQL and MySQL, adding a new column with a default constant can lock large tables. For high-traffic systems, use two steps: add the column nullable, then update in batches, then apply constraints.