Conceptual
Login

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?