The fix began with a new column.
A new column is more than an extra cell in a table. It changes structure, logic, and performance. In SQL, adding one impacts storage, query plans, indexes, and application code that depends on the table schema. Every database engine—PostgreSQL, MySQL, SQL Server—handles it differently. The speed, locking behavior, and default value handling can vary enough to stall production if ignored.
To add a new column, define its name, data type, and constraints. In PostgreSQL:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP DEFAULT NOW();
This locks the table for the operation, so be precise. Setting a default that requires rewriting every row can increase downtime. If a column must hold historical data, plan a backfill. When working in systems with billions of rows, use approaches like creating the column with NULL defaults, then backfilling in batches to avoid performance hits.