Most slow queries are not a database problem — they are a missing-index problem. A short, practical guide to the handful of indexes that carry most apps.
Jakir Hussian · Founder & Engineering Lead
Apr 14, 2026·8 min read
Share
Updated Apr 16, 2026
The Postgres indexes you actually need
Before you reach for a cache, a read replica, or a rewrite, check the query plan. Most latency we are asked to fix comes down to a sequential scan where an index should be — and adding it is a one-line migration.
Read the plan first
sql
EXPLAIN ANALYZE
SELECT * FROM articles
WHERE published = true
ORDER BY published_at DESC
LIMIT 12;
If you see Seq Scan on a large table with a filter and a sort, you have found the fix.
The partial + composite that covers listings
sql
CREATE INDEX idx_articles_published_recent
ON articles (published_at DESC)
WHERE published = true;
#Postgres
#Performance
#Caching
Keep reading
Related articles
More on the same shape of problem — by topic, series, or author.
If the way we think about engineering matches the standard you're after, tell us what you're building. We'll be honest about fit and outline a concrete first step.