user3780483
user3780483

Reputation: 93

MySQL HASH index showing as BTREE for MyISAM database

I have a MyISAM database and am trying to add a HASH index. When I do and then look at the index type, it shows as BTREE. From reading MySQL Hash Indexes for Optimization it looks like HASH is not an option for MyISAM.

How do I alter my database to allow me to use the HASH index type?

Upvotes: 5

Views: 461

Answers (1)

Bill Karwin
Bill Karwin

Reputation: 562398

Neither MyISAM nor InnoDB support HASH indexes.
Only MEMORY and NDB storage engines support HASH indexes.

Here's a good summary of index types and the storage engines that support them: https://mariadb.com/kb/en/storage-engine-index-types/

Why do you want a hash index type so much? What are you trying to achieve that a hash index seems like the only solution? If you edit your question above with a description of what you're trying to do, I'll try to give some suggestions.

Upvotes: 3

Related Questions