Lukas Vileikis explains how hash indexes work in MySQL:
In MySQL, hash indexes are indexes that are used in queries that use the equality operators like
=
or<=>
(which is the MySQLNULL
safe equality operator, equivalent to the SQL StandardIS NOT DISTINCT
FROM
). Hash indexes are not used in other situations, so they can be useful for things like random or generated PRIMARY KEY values where you are looking up single rows and not needing to order rows or searching for a range of values.
Just like in SQL Server hash indexes only work for in-memory tables, and some of the mechanisms look very similar.
Leave a Comment