Runbook category
Observability
You cannot tune what you cannot see. These runbooks are the instrumentation layer: pg_stat_statements to rank real cost, BUFFERS to separate disk from CPU, wait events to explain a stalled session, and the pg_stat_progress_* views that turn "is this VACUUM stuck or just slow?" into a block counter you can quote to someone.
- Free
Find your slowest queries with pg_stat_statements
Everything feels slow and you are guessing which query deserves the blame.
- Pro
Read EXPLAIN (ANALYZE, BUFFERS) like a pro
You cannot tell whether the query is slow from disk reads or from CPU.
- Pro
Track table and index bloat over time
You want a bloat early-warning number instead of finding out when the disk fills.
- Pro
Watch wait events in pg_stat_activity
A session is stuck and you need the reason, not another copy of the query text.
- Pro
Measure and raise your buffer cache hit ratio
Someone wants to buy RAM and nobody has measured whether reads miss the cache.
- Pro
Catch queries spilling to temp files
temp_bytes keeps climbing and no one can name the query writing it.
- Pro
Monitor VACUUM progress on a large table
A VACUUM has run for an hour and you cannot tell slow from stalled.
- Pro
Watch CREATE INDEX CONCURRENTLY progress
CREATE INDEX CONCURRENTLY reports zero blocks done and someone is about to cancel it.
- Pro
Track ANALYZE progress on large and partitioned tables
ANALYZE on a partitioned table looks hung — there is no output until it commits.
- Pro
Monitor a CLUSTER or VACUUM FULL rewrite
The table is locked for a full rewrite and the only question left is the ETA.
- Pro
Monitor COPY progress during a bulk load
A multi-gigabyte COPY prints nothing until it commits, so nobody can give an ETA.
- Pro
Diagnose I/O behavior with pg_stat_io
One cache-hit number for the whole cluster while a nightly report evicts your OLTP pages.
- Pro
Spot checkpoint write pressure before it hurts
Requested checkpoints are outrunning timed ones and I/O spikes follow.
- Pro
Catch a high transaction rollback rate
A retry loop quietly rolls back four transactions in ten and everything looks fine.
- Pro
Read pg_locks: relation waits versus tuple waits
pg_locks shows you the granted row, not the waiting one, and you read it wrong.
- Free
Capture Sev-1 evidence before recovery erases it
Every postmortem ends at 'high load' because the evidence was gone by morning.