Which of the following is a key factor for preferring -trees to binary search trees for indexing database relations?
View worked solution
Answer: D
The correct option is D.
Explanation:
Database relations are stored on secondary storage devices (such as magnetic disks or SSDs), where data transfer between the disk and main memory is performed in fixed-size units called blocks (or pages).
- Binary Search Trees (BSTs): A BST has a maximum fan-out of 2. For a relation with records, the height of a balanced BST is . Since each node access potentially requires a separate disk I/O, searching in a BST is highly inefficient.
- -trees: These are multi-way search trees designed specifically for disk storage. The size of a -tree node is typically made equal to the disk block size. This allows each node to store a large number of keys (high fan-out, e.g., ). Consequently, the height of the tree is reduced to , requiring only to disk I/O operations even for millions of records.
Thus, because data transfer from disks is in blocks, -trees are highly preferred over binary search trees for indexing database relations.
Free practice · Your answers on this page are not saved.
