Adding a new column sounds simple. In production, it can be dangerous. Schema changes can lock your database, block writes, or cause downtime. Every millisecond counts when real traffic is on the line. This is why the way you add a new column matters more than the column itself.
In SQL, the basic syntax is clear:
ALTER TABLE orders ADD COLUMN order_status TEXT;
On a small table, this is fine. On a table with millions of rows, this can cause a full-table rewrite. That’s a risk. In PostgreSQL before version 11, even adding a nullable column with a default value would rewrite the whole table. Newer versions handle this faster by storing the default in metadata.
For MySQL, the impact of ALTER TABLE depends on the storage engine and column position. Adding to the end of a table with InnoDB can be quicker, but still locks the table in many cases. Always check your version and execution plan before running in production.