A hands-on toolkit for diagnosing and fixing PostgreSQL performance problems — the queries, scripts, configuration references, and runbooks an experienced DBA actually reaches for. No abstractions, no
Browse the actual product documentation and code examples included in this toolkit.
Key features of PostgreSQL Optimization Kit
• **PostgreSQL 12 or newer** (examples validated on 13–16). A few queries note • The **`psql`** command-line client on your machine. • For `sql/01`, the **`pg_stat_statements`** extension loaded via • Connection details supplied the standard way (`PGHOST`, `PGPORT`, `PGUSER`, • A role with `pg_monitor` (or superuser) to read the statistics views. • **`run_explain_analyze.sh`** wraps `EXPLAIN (ANALYZE, BUFFERS, VERBOSE)`,
**PostgreSQL 12 or newer** (examples validated on 13–16). A few queries note
The **`psql`** command-line client on your machine.
For `sql/01`, the **`pg_stat_statements`** extension loaded via
Connection details supplied the standard way (`PGHOST`, `PGPORT`, `PGUSER`,
A role with `pg_monitor` (or superuser) to read the statistics views.
**`run_explain_analyze.sh`** wraps `EXPLAIN (ANALYZE, BUFFERS, VERBOSE)`,
Configure PostgreSQL Optimization Kit parameters to see how the product works.
# 1) Spin up a throwaway database and load the demo schema + data. createdb optkit_demo psql -d optkit_demo -f examples/sample_schema.sql # 2) Watch a missing index get fixed, with real EXPLAIN numbers. psql -d optkit_demo -f examples/slow_query_examples.sql | less # 3) Point the diagnostics at a