GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 17(a)

Key-dependent search cost in B-trees and B+ trees

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

GATE 2002, Q17(a) Descriptive
Report issue

Indexing, Storage & Query Processing

Question 17(a), GATE 2002: Original17(a): Fill Constant or Variable in four search-time cells: X1 successful B-tree, X2 unsuccessful B-tree, X3 successful B+tree, X4 unsuccessful B+tree. Constant means independent of which key is sought in a fixed tree, not asymptotically O(1); Variable means depending on that key. Successful means the key exists; unsuccessful means it is absent.
Question 17(a), GATE 2002: Original17(a): Fill Constant or Variable in four search-time cells: X1 successful B-tree, X2 unsuccessful B-tree, X3 successful B+tree, X4 unsuccessful B+tree. Constant means independent of which key is sought in a fixed tree, not asymptotically O(1); Variable means depending on that key. Successful means the key exists; unsuccessful means it is absent.
Question 17(a), GATE 2002: Original17(a): Fill Constant or Variable in four search-time cells: X1 successful B-tree, X2 unsuccessful B-tree, X3 successful B+tree, X4 unsuccessful B+tree. Constant means independent of which key is sought in a fixed tree, not asymptotically O(1); Variable means depending on that key. Successful means the key exists; unsuccessful means it is absent.
Tap to enlarge
Answer & solution

Answer: X1=Variable; X2=Constant; X3=Constant; X4=Constant. (no official key was published)

Interpret search time as the number of tree levels or disk pages visited in a fixed tree, with record retrieval in a B+ tree proceeding to its leaf. A successful B-tree search may stop at the root, an internal node, or a leaf, depending on where its key resides; X1 is Variable. An unsuccessful B-tree search reaches a leaf, and all leaves have equal depth, so X2 is Constant. B+ tree records are located at leaves, so both successful and unsuccessful record searches traverse the fixed-height root-to-leaf path; X3 and X4 are Constant. Here Constant means independent of which key is searched in that tree, not O(1) as the database grows.

Original paper, page 9