Inspired by https://x.com/BenjDicken note about date page buffering

https://x.com/BenjDicken/status/1960737322636599695

I decided to dive into PostgreSQL’s buffer management internals. Most of this comes from the excellent page in Postgres repository

https://github.com/postgres/postgres/blob/master/src/backend/storage/buffer/README

but I’ll try to explain it in a more approachable way. If you want the full technical deep dive, definitely check out the original file.

TL;DR 📝

👉 Together, pins + usage counters + free list + clock-sweep + background writer = a simple, efficient, and concurrency-friendly buffer manager.

For starters, let’s look at the basics: