Choose the best description of why B-trees are used in database systems.
Think about how databases need to quickly find and update records.
B-trees keep data sorted and balanced, enabling fast search, insert, and delete operations, which is essential for database indexing.
In a B-tree of order 4 (maximum 4 children per node), how many keys must a non-root node have at minimum?
Recall that the minimum number of keys is about half the maximum children minus one.
For a B-tree of order 4, each node can have up to 4 children and thus up to 3 keys. The minimum number of keys in a non-root node is ceil(4/2)-1 = 1.
When inserting a key causes a node to overflow in a B-tree, what is the correct sequence of actions during the node split?
Think about the order of splitting keys and updating the parent.
First, find the median key to split the node. Then create two nodes from keys less and greater than median. Next, move the median key up to the parent. Finally, update the parent's children pointers.
Choose the statement that best explains the difference between B-trees and binary search trees (BST) in the context of databases.
Consider how nodes and balance affect search speed in large datasets.
B-trees store multiple keys per node and keep the tree balanced to minimize disk reads. BSTs store one key per node and can become unbalanced, leading to slower searches.
Explain why B-trees are designed to reduce the number of disk input/output (I/O) operations when searching or updating data in databases.
Think about how storing multiple keys per node affects tree height and disk access.
B-trees store multiple keys per node, which reduces the height of the tree. A shorter tree means fewer nodes to read from disk during search or update, thus reducing disk I/O operations.