Mar 12, 2026 · 5 min read
Postgres Indexing That Actually Moves Latency
postgresperformanceindexing
Measure first
“Add indexes everywhere” was worse than waiting for slow query logs. Index on paths you actually filter and join.
High-value patterns
- Foreign keys used in
JOINandWHERE - Composite indexes matching common filters, e.g.
(user_id, created_at DESC) - Avoid low-selectivity single-column indexes that never get used
After adding an index
EXPLAIN (ANALYZE, BUFFERS)the slow query- Watch write amplification on insert-heavy tables
- Drop unused indexes later — they are not free
An 80ms query target is a product requirement. Indexes are how you keep that promise as rows grow.
Index the query, not the table.