In this lesson · topic 3 of 7
Topic 3
Insert thousands of keys and count the pages
7 min read
Count what an insert touches
The lab inserts keys into a B-tree, fifty a tick. The bars show how many pages sit at each level. The numbers below count splits, how full the leaves are, and how many pages each insert has to write. The last number is write amplification: the bytes written, including the log, for each byte of record.
Predict before you press play
Things to try
- Compare random and ascending key order. Read leaf fill and page writes per insert.
- Turn the write-ahead log off and read write amplification.
- With the log on, raise the checkpoint spacing to 5000 inserts.
- Set keys per page to 8 and watch the tree get taller.
- Change how many levels are held in memory and watch reads per lookup.
The full-page lab also has guided experiments to load in one click.