Which statement best describes hash indexes in practice?

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 statement best describes hash indexes in practice?

Explanation:
Hash indexes map a key to a location using a hash function, giving near-constant-time lookups for exact matches. But they don’t keep keys in any natural order, so they can’t efficiently support range scans or returning results in sorted order. That limitation matters because many queries rely on ranges (like finding all records with IDs between two values) or on ordered output. They also aren’t suited for full-text search, which relies on inverted indexes that map terms to documents. Because of these drawbacks, hash indexes are rarely the best overall choice in practice, even though they offer O(1) lookups for exact-key queries. Use them only when you need fast exact-match lookups and will not perform range queries, ordering, or text search on that column.

Hash indexes map a key to a location using a hash function, giving near-constant-time lookups for exact matches. But they don’t keep keys in any natural order, so they can’t efficiently support range scans or returning results in sorted order. That limitation matters because many queries rely on ranges (like finding all records with IDs between two values) or on ordered output. They also aren’t suited for full-text search, which relies on inverted indexes that map terms to documents. Because of these drawbacks, hash indexes are rarely the best overall choice in practice, even though they offer O(1) lookups for exact-key queries. Use them only when you need fast exact-match lookups and will not perform range queries, ordering, or text search on that column.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy