The query landed. The database froze for a fraction of a second, waiting for its next instruction. You need a new column. You need it now.
Adding a new column should be fast, safe, and predictable. In SQL, the ALTER TABLE ... ADD COLUMN command is the simplest way to expand a schema without rewriting existing data. It defines a new field, sets its type, and makes it available for queries instantly. But in production systems with high traffic, a careless change can lock tables, block writes, or cause downtime.
Plan the new column with type, nullability, and default values from the start. Avoid introducing a non-nullable column with no default value on large tables—it forces a full table rewrite, which can be expensive. Where possible, first add the column as nullable, backfill in batches, then enforce constraints.
For PostgreSQL, adding a nullable column without a default is nearly instant. Adding it with a default that’s not constant may trigger a rewrite. MySQL behaves differently, often locking the table during schema changes unless you’re on a version and engine that supports instant DDL. On large datasets, use online schema change tools like pt-online-schema-change or gh-ost to keep operations running.