PostgreSQL performance tuning

Configuration, query and index tuning for self-hosted PostgreSQL, and how to find what is slow before changing settings.

Tuning PostgreSQL autovacuum

Keeping autovacuum ahead of write-heavy tables: scale factors and thresholds per table, cost limits and worker counts, freeze settings, logging slow autovacuum runs and spotting tables it never finishes.

Finding slow queries with pg_stat_statements

Ranking queries by total and mean time with pg_stat_statements: enabling it, query IDs, resetting statistics, planning versus execution time and turning the top entries into a tuning backlog.

PgBouncer transaction pooling and prepared statements

Running PgBouncer in transaction mode without breaking applications: session features that stop working, max_prepared_statements for drivers that use protocol-level prepared statements, pool sizing and recent security fixes.

Asynchronous I/O in PostgreSQL 18

What PostgreSQL 18's asynchronous I/O changes for read-heavy workloads: io_method worker, io_uring and sync, io_workers, combining limits, and how to benchmark before and after an upgrade.

PostgreSQL parallel query tuning

Getting analytical queries to use parallel workers: max_parallel_workers_per_gather and related limits, why plans stay serial, parallel index builds and the effect on concurrent OLTP traffic.

Benchmarking PostgreSQL with pgbench

Load testing PostgreSQL before go-live or an upgrade: pgbench's built-in TPC-B-like test and its limits, custom scripts that mirror your workload, client and thread counts and reading latency results.

PostgreSQL performance audit

What an outside PostgreSQL performance review covers: configuration and hardware checks, top queries from pg_stat_statements, index and bloat analysis, connection handling, and a prioritized fix list with expected effect.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.