Why this matters
Indexes drastically reduce query latency and lock contention.
Index columns used in JOIN/WHERE/ORDER BY; verify plans and avoid full scans for hot queries.
Indexes drastically reduce query latency and lock contention.
Side-by-side examples engineers can pattern-match during review.
-- filtering by email with no index
SELECT * FROM users WHERE email = ?;CREATE INDEX ix_users_email ON users(email);
SELECT id FROM users WHERE email = ?;WHERE email=? on unindexed colCREATE INDEX ...From the same buckets as this rule.
Review SQL/database migrations for operations that can lock large tables or cause downtime. Examples: creating indexes without CONCURRENTLY (Postgres), ALTER COLUMN TYPE on big tables, adding NOT NULL without backfill, long-running updates without batching. Require an online migration strategy (CONCURRENTLY, backfill in batches, dual-write/expand-contract) and a rollback plan.