Creating a new column is not a small choice. It changes how your database stores, indexes, and returns data. Done right, it improves performance, supports new features, and avoids costly migrations later. Done wrong, it locks you into an expensive path.
The simplest way is with ALTER TABLE ... ADD COLUMN. In PostgreSQL:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP WITH TIME ZONE DEFAULT NOW();
This command is fast for empty tables. On large datasets, adding a new column with a default can lock writes. One approach is to add the column without a default, backfill in batches, then set the default and constraints. This avoids long locks and keeps applications online.
Indexes matter. If the new column will be queried often, add an index after the column creation. For rare lookups, skip the index until the need is proven. Unused indexes waste resources and slow writes.