← Lessons

quiz vs the machine

Gold1360

Databases

The Buffer Pool In InnoDB

How InnoDB caches pages in memory to avoid disk reads on hot data.

5 min read · core · beat Gold to climb

The central cache

The buffer pool is InnoDB's in memory cache of data and index pages, normally 16 kilobytes each. Reads and writes operate on pages in the pool; disk is touched only when a needed page is missing or when dirty pages flush. Sizing it well is the single biggest InnoDB tuning lever, often set to a large share of server RAM.

The LRU list with a twist

InnoDB manages the pool with a modified least recently used list split into a young sublist and an old sublist:

  • New pages enter at the head of the old sublist, not the young one.
  • A page promotes to the young sublist only if accessed again after a short delay.

This protects the cache from a single large scan flooding out hot pages, since one time reads stay in the old region and age out quickly.

Dirty pages and flushing

A modified page becomes dirty. The change is durable in the redo log immediately, but the page itself is flushed to its data file later by background threads. This decouples commit latency from random write IO.

Key idea

The buffer pool caches 16 kilobyte pages with a scan resistant LRU, serving hot data from memory and flushing dirty pages to disk in the background.

Check yourself

Answer to earn rating on the learn ladder.

1. Why does InnoDB insert new pages into the old LRU sublist?

2. When is a committed change made durable relative to flushing the data page?