GATE / CS ARCHIVE

GATE CSE 2015 SET 2 / QUESTION 32

GATE CSE 2015 Set 2 Q32

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2015 Set 2 paper

GATE 2015 Set 2, Q32 1 mark · NAT
Report issue

Indexing, Storage & Query Processing

Question 32, GATE 2015: A B+ tree has root separator 9; left internal separator 5 and right internal separators 13, 17. Ordered linked leaves are[1, 3], [5, 7], [9, 11], [13, 15], [17]. Count minimum index nodes fetched, including root, for keys≥7 and<15.
Tap to enlarge
Answer & solution

Official answer: 5

Search from root 9 to internal 5, then leaf[5, 7]. Follow leaf links to[9, 11] and[13, 15], stopping at 15. These are root, one internal node and three leaves: 5 index nodes. Fetches of actual record pages are outside the stated index-node count.

To find the first qualifying key 7, fetch root 9, then the internal node 5, then leaf[5, 7]. Continue using leaf sibling pointers rather than returning to the root: fetch[9, 11], then[13, 15]. The final leaf must be inspected to return 13 and discover the stopping boundary 15, which is excluded. Total distinct index nodes are 2 above-leaf nodes plus 3 leaves=5. The query asks index nodes, not how many record/data pages are subsequently read.

Original paper, page 36 · Answer key