← Lessons

quiz vs the machine

Gold1340

Databases

The Page and Buffer Pool

The buffer pool is the database cache of disk pages in memory, the layer that decides whether a read hits RAM or the disk.

5 min read · core · beat Gold to climb

The Page as the Unit of I O

A database reads and writes the disk in fixed size blocks called pages, typically four to sixteen kilobytes. Even reading one row pulls in the whole page that holds it, because disks are far more efficient at block sized transfers.

What the Buffer Pool Is

The buffer pool is a region of memory that caches recently used pages. It is usually the single largest memory consumer in a relational database.

  • A read first looks for the page in the buffer pool.
  • A hit returns the page from RAM with no disk I O.
  • A miss loads the page from disk into a free slot, possibly evicting another.

Eviction and Replacement

Memory is finite, so the pool must evict pages to make room. Most engines use a variant of least recently used replacement, sometimes split into hot and cold lists to resist scans flooding the cache.

Why It Dominates Performance

The buffer pool hit rate is one of the most important database tuning metrics. A high hit rate means most queries never touch the disk, so throughput is bounded by memory speed rather than slow seeks. Sizing the pool to hold the working set is the single biggest lever for read performance.

Key idea

The buffer pool caches fixed size disk pages in memory, and its hit rate largely determines whether reads run at memory speed or disk speed.

Check yourself

Answer to earn rating on the learn ladder.

1. What is the unit of I O between disk and the buffer pool?

2. What happens on a buffer pool miss?

3. Why is the buffer pool hit rate a key tuning metric?