GATE / CS ARCHIVE

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

Estimate occupancy with left redistribution

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

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

Indexing, Storage & Query Processing

Question 21(c)(ii), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence, moving a key to the left sibling before splitting whenever that sibling has room. Estimate average leaf occupancy.
Question 21(c)(ii), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence, moving a key to the left sibling before splitting whenever that sibling has room. Estimate average leaf occupancy.
Question 21(c)(ii), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence, moving a key to the left sibling before splitting whenever that sibling has room. Estimate average leaf occupancy.
Question 21(c)(ii), GATE 2000: A B+-tree leaf holds at most m keys. Insert a long increasing sequence, moving a key to the left sibling before splitting whenever that sibling has room. Estimate average leaf occupancy.
Tap to enlarge
Answer & solution

Answer: Approximately m keys per leaf, approaching full occupancy. (no official key was published)

New keys continue to enter the rightmost leaf. Whenever it overflows, move its smallest key into its left sibling if possible. Repeated overflows progressively fill that left sibling to m entries. Only once that sibling is full must the rightmost leaf split; at that moment the earlier leaves are already full and will receive no more keys. After a split the two rightmost leaves can be partly full, but later insertions fill the older of them by redistribution. Consequently all except at most the final two leaves are full. If there are L leaves, their combined deficit from Lm keys is O(m), independent of L, so average occupancy is m−O(m/L) and tends to m as L grows. This is the improvement over ordinary splitting’s approximately half-full completed leaves for monotone input. Parent separator updates are essential for correctness but do not change the leaf occupancy calculation.

Original paper, page 10