Buffers in a Plan: shared hit Means Memory, shared read Means Disk
Plan buffer counts say how many 8 KB pages each step touched and where they came from: shared hit is a page already in the database's memory cache, shared read is a page it had to fetch, and temp read/written means the step spilled to temporary files. PostgreSQL 18 prints these by default with EXPLAIN ANALYZE. Because pages are a unit of work that does not change between a warm run and a cold one, buffer counts are a steadier measure of how much a query really did than milliseconds are.
Questions this Concept answers
Why is a buffer count often a more trustworthy measure of a query's work than its elapsed milliseconds?
J
jeremy
Video
Interpreting Shared Buffer Hits from EXPLAIN (ANALYZE, BUFFERS) in Nested Loops in PostgreSQL
The BUFFERS option of EXPLAIN ANALYZE attributes I/O accounting to each node of a PostgreSQL query plan, reporting how many fixed-size blocks (buffers, 8 kB by default) each node touched and whether …