GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 21(c)(i)

Estimate sorted-insertion leaf occupancy

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2000 paper

GATE 2000, Q21(c)(i) Descriptive
Report issue

Indexing, Storage & Query Processing

Question 21(c)(i), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence using ordinary balanced splits on overflow. What is the approximate average number of keys per leaf?
Question 21(c)(i), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence using ordinary balanced splits on overflow. What is the approximate average number of keys per leaf?
Question 21(c)(i), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence using ordinary balanced splits on overflow. What is the approximate average number of keys per leaf?
Tap to enlarge
Answer & solution

Answer: Approximately m/2; more precisely the frozen left split size, usually floor((m+1)/2), up to rounding and a boundary leaf. (no official key was published)

All new larger keys enter the rightmost leaf. When it overflows with m+1 keys, a balanced split leaves about half in the old left leaf and half in a new rightmost leaf. The old left leaf will never receive another key during an increasing insertion sequence. Repeating this process freezes nearly every completed leaf at its half-full split occupancy. Only the final rightmost leaf varies between its initial split size and m, and its contribution to the average vanishes as the number of leaves grows. Therefore the average is approximately m/2, not the roughly 69% occupancy sometimes quoted for random insertions. If the convention gives the left leaf floor((m+1)/2) keys, the limiting average is that integer. For m=5 and a3+3 split this is exactly 3 in the limit. Rounding and the choice of which side gets an extra key for even m explain why the question asks approximately.

Original paper, page 10