Questions: B-Tree Indexes

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A database has a composite B+ tree index on (last_name, first_name). A query filters only on first_name. Will the index speed up this query?

AYes — the index covers both columns, so any query touching either column can use it
BNo — the B+ tree is sorted by last_name first; without a last_name filter, the index cannot narrow the search and a full index scan is needed
CYes — the leaf linked list allows the database to scan first_name values efficiently in sorted order
DNo — composite indexes never improve query performance; only single-column indexes do
Question 2 Multiple Choice

Why does a B+ tree with branching factor 500 reach billion-row tables in only 4–5 levels, while a binary search tree would need roughly 30+ levels for the same data?

AB+ trees use a different sorting algorithm than binary trees, making each comparison more powerful
BEach B+ tree level eliminates 500 candidates (not 2), so 500⁴ ≈ 62.5 billion rows fit within 4 levels; a binary tree requires log₂(n) levels, which is ~30 for a billion rows
CB+ trees cache their upper levels in memory, making higher levels invisible to the performance calculation
DBinary trees require more disk space per node, forcing more levels
Question 3 True / False

In a B+ tree as used by relational databases, data records are stored in both internal (non-leaf) nodes and leaf nodes.

TTrue
FFalse
Question 4 True / False

A B+ tree index efficiently supports range queries (e.g., WHERE age BETWEEN 25 AND 40) because its leaf nodes are linked in sorted order.

TTrue
FFalse
Question 5 Short Answer

Why are B-trees used for database indexes instead of binary search trees? What property of storage systems drives this design choice?

Think about your answer, then reveal below.