Adding a new column to a database table is one of the most common schema changes. It can be simple in development but dangerous in production if done without care. The way you create, backfill, and index a column can decide whether your system stays fast or grinds to a halt.
Start by deciding the column name, data type, and nullability. Choose types that match your query patterns. Avoid wide types if storage or performance is a concern. When possible, make the new column nullable at first to avoid locking writes on large tables.
Use ALTER TABLE with caution. Some engines lock the table during DDL changes. For massive datasets, break the process into steps. First, add the new column without constraints or defaults. Next, backfill in batches to avoid load spikes. Then, apply indexes or constraints once the data is in place.