← blog

optimising postgresql for heavy read workloads

December 20, 2024 · 11 min read

Postgres is remarkably capable out of the box, but defaults are tuned for safety not performance. Here's what I changed to handle 50 M rows at low latency.

explain analyse first

Never optimise blind. EXPLAIN ANALYSE shows the query plan, actual row counts, and where time is spent...

index strategies

Covering indexes, partial indexes, and expression indexes each solve a different class of slow query...

connection pooling with pgbouncer

Postgres has a hard connection limit. PgBouncer multiplexes thousands of application connections over a small pool...

read replicas

Offloading reads to a streaming replica cuts primary load and reduces latency for geographically distributed users...

postgresql · performance · node.js

more

typescript patterns for large-scale applicationsbuilding autonomous ai agents with langchain & reactmulti-agent workflows with crewai and autogen