Which of the following statements about B-trees and B+ trees is correct?
1999
Which of the following statements about B-trees and B+ trees is correct?
- A.
B-trees are for storing data on disk and B+ trees are for main memory.
- B.
Range queries are faster on B+ trees.
- C.
B-trees are for primary indexes and B+ trees are for secondary indexes.
- D.
The height of a B+ tree is independent of the number of records.
Attempted by 56 students.
Show answer & explanation
Correct answer: B
The correct answer is: Range queries are faster on B+ trees.
In a B+ tree, all actual data entries or record pointers are stored at the leaf level, and the leaves are usually linked in sorted order.
For a range query, we first search for the starting key. After reaching the first matching leaf entry, the rest of the range can be read by following the linked leaves sequentially.
This makes range scans more efficient in B+ trees than in ordinary B-trees, where data entries can appear in internal nodes as well.
The other statements are not correct: both B-trees and B+ trees can be disk-based index structures, their use is not simply primary versus secondary indexing, and B+ tree height still depends on the number of records.