CSE Roadmap

Common tier · about 2 hours · 5 parts

Part 2 of 5 · 1 min read

Why heavy writes strain a B+-tree

Every write touches a page in place, and random access patterns get expensive at high volume.

Think of re-filing one folder back into its exact spot in a large, sorted cabinet. Now imagine doing that thousands of times a second.

In plain words: a B+-tree update modifies a specific leaf page in place, following the same write path covered in Level 4: locate the page, change it, log the change, flush it eventually. Each of these updates lands on a different, effectively random page scattered across disk. At very high write volume, this adds up to a large number of scattered, random page writes, which is exactly the access pattern that random-access media handles worst, as covered back in Level 4's storage media page.

A worked example. A system logging millions of sensor readings per minute, each touching a different leaf page scattered across a B+-tree index, spends heavily on scattered random writes rather than on the actual data volume.

The key lines. No new SQL; this is a structural cost of how a B+-tree physically updates pages, not something a query changes.

Write amplification (random pages)

Write amplification here refers to the extra disk work caused by many small updates landing on scattered, random pages, rather than being written in a few large, sequential chunks.

Example: re-filing one folder into its exact alphabetical slot thousands of times a second, instead of writing a whole new batch of folders in one pass, mirrors this scattered cost.