The disadvantages of a hash index
Hash tables are not sorted data structures, and there are many types of queries which
hash indexes can not even help with. For instance, suppose you want to find out all of
the employees who are less than 40 years old. How could you do that with a hash
table index? Well, it’s not possible because a hash table is only good for looking up
key value pairs – which means queries that check for equality (like “WHERE name =
‘Jesus’”). What is implied in the key value mapping in a hash table is the concept that
the keys of a hash table are not sorted or stored in any particular order. This is why
hash indexes are usually not the default type of data structure used by database
indexes – because they aren’t as flexible as B- trees when used as the index data
structure. Also see: Binary trees versus Hash Tables.