0
0
DBMS Theoryknowledge~5 mins

Hash indexes in DBMS Theory - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a hash index in a database?
A hash index is a type of database index that uses a hash function to map search keys to specific locations, allowing fast data retrieval based on exact matches.
Click to reveal answer
beginner
How does a hash function help in hash indexing?
A hash function converts a search key into a fixed-size value (hash code) that points to the location where the data is stored, enabling quick access without scanning the entire dataset.
Click to reveal answer
beginner
What type of queries are hash indexes best suited for?
Hash indexes are best for queries that look for exact matches, such as finding a record with a specific key value, but they are not efficient for range queries.
Click to reveal answer
intermediate
What is a limitation of hash indexes compared to B-tree indexes?
Hash indexes do not support range queries or ordered traversal of data, while B-tree indexes allow both exact match and range queries efficiently.
Click to reveal answer
intermediate
What happens if two keys produce the same hash value in a hash index?
This is called a collision. Hash indexes handle collisions using methods like chaining (linking entries) or open addressing (finding another slot), ensuring data can still be retrieved correctly.
Click to reveal answer
What is the main advantage of using a hash index?
ASupports full-text search
BEfficient range queries
COrdered data traversal
DFast exact match lookups
Which of the following is a common problem in hash indexes?
ASlow insertions
BData duplication
CCollisions
DLack of indexing
Hash indexes are NOT suitable for which type of query?
AExact match queries
BRange queries
CSingle record retrieval
DEquality searches
Which data structure is commonly used as an alternative to hash indexes for range queries?
AB-tree
BStack
CLinked list
DQueue
What does a hash function do in a hash index?
AMaps keys to storage locations
BSorts the data
CCompresses data
DEncrypts data
Explain how a hash index works and when it is most useful.
Think about how a key is transformed and used to find data quickly.
You got /4 concepts.
    Compare hash indexes with B-tree indexes in terms of query types they support.
    Consider what kinds of searches each index type handles best.
    You got /4 concepts.