If I have a table where certain fields are always searched using an equality operator (where id=5) would it be better to use a hash index. I read that Hash indexes are better at this kind of query but are unsuitable for range queries.
Should I use a hash index in this case. Are there any disadvantages to hash for this scenario.
You can’t use HASH Indexes with MyISAM or InnoDB. So, if you are using MEMORY or NDB (Cluster) storage (which you probably aren’t), you can use HASH Indexes.
BTree are more flexible (you can use to retrieve sorted data on index key, you can use to resolve ranged-queries) so, unless you have a very specific case (a EQUALITY-ONLY lookup query, on a special storage) just go for BTree.