Postgres Performance: From Slow to Pro
summary
Postgres tuning focuses on concrete changes: set shared_buffers to about 25% of RAM and aim for a cache-hit ratio in the high 90s, raise work_mem from the tiny default to ~16–20MB on an 8GB box, and keep max_connections aligned with capacity (default 100). Turn on pg_stat_statements, log temp files and long statements, use PG Bouncer when connections climb, add B-tree or BRIN indexes (example: index reduced a query from ~30ms to ~3ms), and watch table bloat >50%.
AI-written summary · about
chapters (16)
- 0:00Postgres performance intro
- 3:54Machine vs app tuning
- 7:08Shared buffers config
- 10:17Working memory & temp files
- 12:04CPU monitoring & timeouts
- 14:33Table bloat explained
- 16:39Version upgrades matter
- 17:42Efficient connections
- 21:17Finding app performance issues
- 24:49Logging & monitoring tools
- 28:03PG stat statements
- 30:08Query explain plans
- 34:01Indexing queries
- 38:47Data modeling best practices
- 40:10N+1 query fixes
- 42:19Final Postgres tips
related talks
45mProper PostgreSQL Parameters to Prevent Poor Performance
31mPostgres Performance for Humans
34mTuning PostgreSQL to work even better
33mTuning PostgreSQL to work even better
27mPostgres Performance in 15 Minutes
48mPractical Memory Tuning for PostgreSQL
57mPostgreSQL When It's Not Your Job
25mScaling PostgreSQL Beyond Query Optimization
