Understanding B-Trees and Hash Indexes in Databases
Explore the differences and use-cases of B-Trees and Hash Indexes in database indexing.
Questions in this quiz
12 questions on Understanding B-Trees and Hash Indexes in Databases. Work through them here, then start the quiz to answer them and see your score.
1.What is a primary advantage of using a B-Tree index over a Hash index?
- AB-Trees require less disk space.
- BB-Trees support range queries efficiently.
- CB-Trees are faster for exact match queries.
- DB-Trees are easier to implement.
2.Which type of index is generally faster for exact match queries?
- AHash index
- BB-Tree index
- CBitmap index
- DFull-text index
3.Why might a B-Tree index be preferred for a column with a high degree of distinct values?
- AIt uses less memory.
- BIt provides efficient range queries.
- CIt is faster for updates.
- DIt handles duplicate values better.
4.In which scenario is a Hash index NOT suitable?
- ARange queries
- BExact match queries
- CEquality checks
- DUnique value lookups
5.What is a potential disadvantage of using a Hash index?
- AIncreased memory usage
- BComplex implementation
- CLack of support for range queries
- DSlower exact match queries
6.Which index type is generally more space-efficient for large datasets?
- AClustered index
- BHash index
- CBitmap index
- DB-Tree index
7.How does a B-Tree index improve search performance?
- ABy hashing keys
- BBy maintaining sorted order
- CBy compressing data
- DBy storing data in arrays
8.Which index type would you choose for a column frequently used in equality checks?
- ASpatial index
- BBitmap index
- CHash index
- DB-Tree index
9.What is a key characteristic of a B-Tree index?
- AIt uses a hash function.
- BIt is only used for text data.
- CIt maintains a balanced tree structure.
- DIt stores data in linked lists.
10.Which index type is more suitable for columns with low cardinality?
- AB-Tree index
- BHash index
- CBitmap index
- DFull-text index
11.What is a common use case for B-Tree indexes?
- AStoring binary data
- BRange queries
- CExact match queries
- DHandling high cardinality
12.Why are Hash indexes not suitable for range queries?
- AThey do not maintain order.
- BThey are complex to implement.
- CThey are too slow.
- DThey use too much memory.