PostgreSQL: Page Buffer Overview
summary
Explains how PostgreSQL keeps 8KB pages in a shared buffer (default 128 MB, recommended ~25% RAM) and a hash lookup maps requests to ~16,364 buffer slots; page size is compile‑time fixed. Shows numbers: a table with ~10,632 disk pages, an index lookup reads 14 pages (4 shared hits), a sequential scan loads ~10,623 pages while only 42 buffer slots cycle. Describes usage counter max 5, pin count blocks eviction, free list, clock‑sweep victim selection, dirty pages written via WAL, and monitoring with pg_buffercache / pg_stat_io.
AI-written summary · about
chapters (15)
- 0:00Introduction to buffer cache
- 1:33Shared memory pages and 8KB blocks
- 3:45Double buffering in PostgreSQL
- 5:13Shared buffers vs effective cache size
- 5:56Physical page size and storage
- 7:42Page structure and organization
- 12:43Querying and buffer cache examples
- 19:52Cache building over time
- 20:35Buffer management overview
- 25:50Clock sweep eviction algorithm
- 31:14Monitoring buffer cache with pg_buffercache
- 33:25Effective cache size in query planning
- 35:12Dirty pages and eviction process
- 36:26Buffer flushing during eviction
- 38:11Summary and Q&A
related talks
50mInside PostgreSQL Shared Memory
45mEnhancing PostgreSQL Plasticity: New Frontiers in Memory Management
45mProper PostgreSQL Parameters to Prevent Poor Performance
26mLinux and PostgreSQL in the Multiverse of Connections
52mPostgreSQL Index Strategy Guide
48mPractical Memory Tuning for PostgreSQL
33mTuning PostgreSQL to work even better
34mTuning PostgreSQL to work even better
