Try
↑ ↓ move↵ openesc close
In this lesson · topic 7 of 7
  1. 1. A disk reads pages, not keys
  2. 2. Walking down, splitting up
  3. 3. Insert thousands of keys and count the pages
  4. 4. One small record, one whole page
  5. 5. The log lets the pages wait
  6. 6. How often to write the pages out
  7. 7. Pages, splits and the log

Topic 7

Pages, splits and the log

3 min read

Predict first

When does a B-tree get taller?

Predict first

Why can the engine call an insert committed before the changed page is on disk?

Predict first

You lengthen the checkpoint interval and page writes per insert fall. What have you given up?

Take away

  • A disk reads pages, so a B-tree makes each node a page of many keys and stays shallow.
  • A lookup reads one page per level. The top levels stay in memory.
  • An insert into a full page splits it, and splits can climb to the root.
  • A page is much bigger than a record, so every write is amplified. Random keys make it worse.
  • A write-ahead log makes a change durable with one small append, and lets dirty pages wait.
  • Checkpoint spacing trades page writes against recovery time.

Sources

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms