The query came back slow. You checked the schema. You saw it: no created_at field. No way to sort. No way to filter. The fix was simple. Add a new column. Ship it.
Adding a new column is one of the most common schema changes in active systems. Yet mistakes here can cascade into outages, lock contention, or data corruption. You must handle it with precision.
First, define the purpose of your new column. Decide its type: integer, varchar, timestamp, jsonb. Choose a name that reads clearly. Avoid reserved words. Match the naming convention already in your schema.
Second, plan the change for your database engine. In PostgreSQL, ALTER TABLE table_name ADD COLUMN column_name data_type; runs fast for metadata-only additions. But watch for cases with defaults or not-null constraints—they can rewrite the whole table and block writes. For MySQL, adding a column may lock the table depending on storage engine and column position.