Which index type cannot efficiently support range queries?

Test your Systems Design Concepts knowledge with our comprehensive quiz. Utilize flashcards and multiple choice questions to enhance your study session. Prepare thoroughly with detailed explanations for each answer and ace your examination!

Multiple Choice

Which index type cannot efficiently support range queries?

Explanation:
Range queries depend on scanning a sequence of keys in a known order. A hash index uses a hash function to assign each key to a bucket, and that mapping hides any overall ordering. Because there’s no natural order to follow, you can’t efficiently walk from a lower bound to an upper bound; answering a range query would force examining many buckets and then filtering, which destroys the performance benefits of an index. In contrast, a B-tree keeps keys sorted, so you can locate the start of the range and scan through consecutive keys with good I/O efficiency. Geohash enables some spatial range searches via prefix matching, and inverted indexes are optimized for exact-term lookups rather than ordered ranges. So the hash index is the one that cannot efficiently support range queries.

Range queries depend on scanning a sequence of keys in a known order. A hash index uses a hash function to assign each key to a bucket, and that mapping hides any overall ordering. Because there’s no natural order to follow, you can’t efficiently walk from a lower bound to an upper bound; answering a range query would force examining many buckets and then filtering, which destroys the performance benefits of an index. In contrast, a B-tree keeps keys sorted, so you can locate the start of the range and scan through consecutive keys with good I/O efficiency. Geohash enables some spatial range searches via prefix matching, and inverted indexes are optimized for exact-term lookups rather than ordered ranges. So the hash index is the one that cannot efficiently support range queries.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy