B-Tree vs Hash Index

Difficulty: Intermediate

Question

Why is B-Tree the default index over Hash Index?

Answer

B-Trees support range queries (e.g., `WHERE age > 18`) and sorting. Hash indexes only support exact equality matches (`WHERE id = 5`).

Concepts covered

Indexing, Efficiency