Adding a new column is more than a schema change. It touches queries, indexes, and performance in ways that cascade through a database. In production systems, one careless migration can lock writes, stall reads, and break services. The operation must be fast, reversible, and precise.
In SQL, ALTER TABLE is the standard command to create a new column. Use well-defined data types. Avoid NULL defaults unless the design calls for them. When possible, set defaults and constraints at creation so no later backfill slows the system.
For PostgreSQL, ALTER TABLE users ADD COLUMN last_login TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP; completes instantly for metadata-only changes, but heavy default values on large tables can trigger rewrites. For MySQL, adding a column without NOT NULL and default clauses is faster, but you may sacrifice clarity and constraints.
Indexing the new column adds query speed but increases write cost. Create indexes only when queries prove the need. Test read patterns against the updated schema in staging before production rollout.