The table was broken. Queries ran slow. Data drifted. The fix started with one command: add a new column.
A new column changes a schema. It stores fresh data, supports new features, and simplifies joins. In relational databases, adding a column means altering the table definition. In SQL, it’s explicit:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This defines a new field last_login to track when a user signed in last. Once created, it can be indexed to speed queries:
CREATE INDEX idx_users_last_login ON users(last_login);
Performance depends on the database engine. In PostgreSQL, adding a nullable column takes seconds. In MySQL with large datasets, it can lock the table. For production systems, plan schema changes during low traffic windows or run them online with tools like gh-ost or pt-online-schema-change.