Skip to content
About
Main content

A buffer pool is the path, not a shortcut

Why is a buffer-pool miss not optional, and why is eviction a transaction rather than a deletion?

Ownership assumed that the bytes you allocated were yours to keep. Residency is the opposite situation: the data is larger than memory by construction, permanently, and the only question is which fraction of it is present at any instant.

The difference from caching is a property that sounds pedantic and turns out to be load-bearing:

That is the whole difference. Evicting from a cache is a free decision. Evicting from a buffer pool may require writing a to disk. That may in turn require first flushing the , which is an fsync on a different device. Everything strange about buffer-pool design follows from that.

The core tension is a table of conflicts:

The pool must……which conflicts with
Hit ratekeep the pages that will be referenced againnot knowing the future
Hit-path costrecord every reference, to know what is hotevery recorded reference is a write to shared state
Correctnesshold pinned and unflushed pages regardless of usefulnessthe pool's usable size shrinking exactly under pressure
Sizingbe large enough to hold the the marginal value of RAM falling steeply while it costs money

Rows 1 and 2 fight each other directly. A better replacement policy needs more information about references. Collecting that information costs shared-memory writes on the fastest path in the system. Most of the design history of buffer pools is not a search for a better policy. It is a search for a policy whose bookkeeping is cheap enough to be worth its own hit rate. Hold that thought: it explains why the theoretically best algorithms are the ones production systems do not run.