Search code examples
mysqlindexinghashtableb-tree

How to enable hash table index in MySQL?


On MySQL 5.7, I whenever I create an index, despite specifying its type (BTREE or HASH), the index created is always BTREE. Does anyone know how to enable HASH for indexing? I plan to use it on low cardinality columns.


Solution

  • InnoDb and MyIsam don't support Hash index ( https://dev.mysql.com/doc/refman/5.7/en/create-index.html )

    enter image description here

    But you can use adaptive hash index ( https://dev.mysql.com/doc/refman/5.7/en/innodb-adaptive-hash.html )