A table has a hundred million rows in a B-tree with a branching factor of about 500. Roughly how many page reads is a point lookup?
Sketch your own answer first, then compare it with the one below.
A strong answer
About three to four. With 500 children per page, one level reaches 500 leaves, two levels reach 250 thousand, three levels reach 125 million. So a tree of height three or four covers the table.
In practice fewer reads go to disk. The root and often the second level are hot and stay in the buffer cache, so a lookup may do one or two real reads.
A good answer says the cost grows with the logarithm of the table size, base the branching factor, and that this base is large.
Sources
- Goetz Graefe (2011). Modern B-Tree Techniques.