Adding a new column to a table is one of the most common schema changes in any database. It sounds simple, but done wrong it can block queries, lock rows, or bring down a production system. Understanding the trade-offs between speed, safety, and backward compatibility is critical.
In relational databases like PostgreSQL and MySQL, ALTER TABLE ADD COLUMN is straightforward. By default, it adds the column to the end of the table definition. If you specify a default value that is not NULL, the database may rewrite the entire table. On large datasets, that rewrite can take minutes or hours and block writes. If the default is NULL, the operation is often instant because the database stores the default in metadata rather than touching each row.
Adding a new column with a constraint or index can also create performance issues. Primary keys, foreign keys, and unique constraints require checks across existing data. Index creation may lock writes unless you explicitly use concurrent index builds where your database supports them.