12, 12 chapters
pages and the buffer pool
everything.storage
pages and the buffer pool
where rows physically live. files, 8 KB pages, tuple headers, TOAST, and the cache in front of the disk.
- 12.01disks, memory and why pages exista random read on SSD vs RAM, and why databases move 8 KB at a time.
- 12.02the files behind a tablerelfilenodes, the main, fsm and vm forks, 1 GB segments, and pg_relation_filepath.
- 12.03the 8 KB pagea header, line pointers growing down, tuples growing up, free space in the middle. ctid, finally explained.
- 12.04inside a tuplea 23-byte header, the null bitmap, alignment padding, and why column order changes table size.
- 12.05TOASTa 1 MB value in an 8 KB page: compressed first, then sliced into a side table.
- 12.06the free space map and the visibility mapwhere the next row goes, and the bit that lets vacuum and index-only scans skip a page.
- 12.07fillfactorleaving room on purpose, so an update can stay on the same page.
- 12.08the buffer poolshared_buffers, the buffer table, pins, and what Buffers: shared hit=3 really counted.
- 12.09clock sweepusage counts, a hand that goes round, and why postgres doesn't do plain LRU.
- 12.10ring bufferswhy one seq scan over a huge table doesn't flush everyone else's cache.
- 12.11writing dirty pages backthe background writer, the checkpointer, and the OS page cache sitting under all of it.
- 12.12asynchronous I/Opostgres 18+read streams, io_method = worker or io_uring, and what postgres 18 changed about reading.