Adding a new column should be simple. In SQL, it starts with ALTER TABLE. You define the column name, type, and any constraints. Example:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
This runs instantly on small datasets. On production systems, size and indexing matter. Adding a new column with a default value on a large table can lock writes or trigger a full table rewrite. For critical systems, plan migrations in stages. First, add the column as nullable without a default. Then backfill data in controlled batches. Finally, set defaults and constraints.
Indexing decisions depend on how the column will be queried. An index can speed reads but slow writes. Use CREATE INDEX only where there is a clear query path. Test against real workloads.
For databases at scale, watch disk usage and replication lag. Adding a non-null column with a default value in Postgres 11+ is fast, but older versions behave differently. MySQL varies by engine. Document the version-specific impact before deployment.