Adding a new column in your database should be fast, safe, and predictable. In production, the wrong approach can lock tables, drop performance, or break downstream systems. The right approach depends on your database engine, schema size, and deployment workflow.
For PostgreSQL, ALTER TABLE ADD COLUMN is efficient for most cases, but wide tables or heavy write loads demand planning. Use default values cautiously—adding a column with a non-null default will rewrite the table. If you only need a default for new rows, add the column as nullable, then use ALTER TABLE ALTER COLUMN SET DEFAULT without forcing a rewrite.
In MySQL, operations vary by storage engine. With InnoDB, adding a nullable column without a default can often be instant in newer versions, but adding a default or changing order may trigger a full table copy. Always check your MySQL version and use ALGORITHM=INSTANT or ALGORITHM=INPLACE where possible.