Adding a new column sounds simple. It isn’t. In relational databases, a ALTER TABLE ADD COLUMN command changes the schema. Even in systems with online DDL, the process can create locks, trigger rewrites, or cascade into replication lag. The impact isn’t just on storage; it affects query plans, indexes, and the applications relying on the table.
When you add a new column in PostgreSQL, MySQL, or MariaDB, understand the cost. Some engines can add a nullable column without touching existing rows, others will rewrite the full table. On large datasets, that rewrite means heavy I/O and potential downtime. In production workloads, even online schema changes run into constraints: buffer pool pressure, transaction log growth, and altered execution plans.
Plan for the data type. A TEXT or JSONB column changes how the optimizer estimates rows. A TIMESTAMP WITH TIME ZONE column adds default behaviors that may surprise downstream consumers. Decide if you need a default value at creation, or if you can backfill with controlled batches later.