PostgreSQL & Databases
EXPLAIN ANALYZE BUFFERS: failure analysis
EXPLAIN ANALYZE with BUFFERS shows the blocks each plan node read from shared buffers or the operating system. Those counts explain slow runs that the plan text alone does not show.
What you will be able to do
- Explain what shared hit and shared read show in an EXPLAIN ANALYZE plan.
- Decide whether a slow query needs a plan change or a look at cache state, using buffer counts.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in PostgreSQL & Databases
- Partial indexes: failure analysisAdvanced · 5 min
A partial index covers only rows that match its predicate. The planner uses it only when it can prove the query's condition implies that predicate, which is often lost…
- Index only scans: operational verificationAdvanced · 5 min
An index-only scan answers a query from the index, but it still reads table pages that the visibility map does not mark as all-visible. Heap fetches show how much table…
- Planner statistics: operational verificationAdvanced · 5 min
The planner chooses plans from row estimates that come from statistics collected by ANALYZE. A bulk load leaves those statistics stale until the table is analyzed again.
- HOT updates: failure analysisAdvanced · 5 min
A HOT update writes the new row version on the same page without new index entries, but only when no indexed column changes. Indexing a column that changes on every…
- WAL fundamentals: operational verificationAdvanced · 5 min
Write-ahead logging writes each change to the log before the data page changes. The log is the basis of crash recovery, replication and archiving, so its volume follows…