A practical, open-source handbook for PostgreSQL performance optimization based on 15+ years of production experience leading large engineering teams.
As a Tech Lead managing 50+ engineers across software and data teams, I found myself repeatedly teaching the same PostgreSQL optimization patterns. This handbook codifies that knowledge: the real production issues we hit, the solutions that worked, and the gotchas we learned the hard way.
Not trying to sell anything. Just documenting what we teach our teams.
This is a quick-reference companion, not a replacement for comprehensive PostgreSQL books like PostgreSQL: Up and Running, The Art of PostgreSQL, and others that provides deep foundations. This handbook assumes you have that background and need fast, practical answers to common production problems.
If you're new to PostgreSQL, start with those books first. Come back here when you're debugging a slow query at 2am.
Website: [Coming soon] GitHub: You're here
This book is written in AsciiDoc and uses Asciidoctor to generate HTML, PDF, and EPUB formats.
- Ruby 2.7+
- Bundler
bundle installbundle exec rake book:buildOutput files will be in the output/ directory.
HTML:
bundle exec rake book:build_htmlPDF:
bundle exec rake book:build_pdfEPUB:
bundle exec rake book:build_epubbundle exec rake book:clean.
├── postgresql_tunning.asc # Main book file
├── book/
│ ├── chapters/ # Chapter content
│ │ └── NN-chapter-name/
│ │ ├── chapter.asc # Chapter file
│ │ └── sections/ # Section files (for large chapters)
│ ├── images/ # Book images
│ └── contributors.txt # Auto-generated contributors list
├── Gemfile # Ruby dependencies
└── Rakefile # Build tasks
Based on the excellent Pro Git 2 project structure.
Corrections, examples, and translations welcome. See CONTRIBUTING.md.
Thanks to @mrwbarg for the initial contribution.
Free to use for education and personal projects. Contact for commercial licensing.
Note: This is a teaching tool, not comprehensive documentation. Covers common production issues our teams encounter, not every PostgreSQL feature.