Why does a B-tree write far more bytes than the application asked it to?
Sketch your own answer first, then compare it with the one below.
A strong answer
The unit of writing is a page. Changing one 100 byte record dirties a whole page of several kilobytes, so the engine writes the whole page for a small change. That is write amplification.
The log adds a second write of every change. Splits add more, because a split writes two leaves and a parent. Some engines also write a full copy of a page the first time it changes after a checkpoint, to survive a torn write.
You reduce it with larger checkpoint intervals, so a page that changes many times is written once, and with sequential keys, so each insert dirties the same few pages. A good answer names the page size as the multiplier.
Sources
- Goetz Graefe (2011). Modern B-Tree Techniques.