In modern databases, adding a new column is common, but it can wreck performance if you do it without a plan. Schema changes alter storage layout, indexing, and query execution. On large tables, this can translate into downtime, slow queries, or blocked writes.
In SQL, the standard approach is to use ALTER TABLE with an ADD COLUMN statement. The basic syntax is:
ALTER TABLE table_name
ADD COLUMN column_name data_type;
On small tables, this is instant. On large production tables, it can lock the table for the duration of the change. Some databases, such as PostgreSQL, can add nullable columns without a table rewrite. Others require a full copy of the data. Always check the engine’s documentation.
If the new column requires a default value or a non-null constraint, consider creating it as nullable first, then backfilling in batches. After the data is populated, set the constraint. This reduces blocking and avoids locking the table for long periods.