← Back to writing
Field Note№ 014 · Field notes from the studio

Postgres tuning, without ceremony

FIELD NOTE№ 014Studio D&M09 Nov 2025pg

Before you reach for a read replica, reach for an index and EXPLAIN. The boring fixes are usually the big ones.

Most “we need to scale the database” conversations end the moment someone actually runs EXPLAIN ANALYZE. The slow query is doing a sequential scan over a table that should have been indexed months ago.

psql
EXPLAIN ANALYZE
SELECT * FROM entries
WHERE account_id = $1
ORDER BY created_at DESC;
  • Index the filter and the sort. A composite index often replaces a replica.
  • Watch for N+1 before you blame the engine.
  • Measure, then change one thing. Tuning by vibes makes things worse.

Replicas, partitioning, and connection pools are real tools — for real problems, reached for last. Most teams are three indexes away from fine.

MMarcus Okafor · Studio D&MEnd of note
Keep reading
← Newer note№ 015

The case against component libraries

Essay · 10 min
Older note →№ 013

Designing for readers

Essay · 8 min