MySQL何时可以使用HASH而不是BTREE [英] MySQL when can I use HASH instead of BTREE

查看:458
本文介绍了MySQL何时可以使用HASH而不是BTREE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于MySQL在创建索引时默认使用 BTREE ,是否有一些实例可以使用 HASH ?例如,如果我的表只包含 INT UNSIGNED 值的外键。在这种情况下用HASH覆盖BTREE是否是一个很好的改进?



不确定是否重要,但我使用 InnoDB

解决方案

仅支持 HASH 索引类型为 MEMORY (aka HEAP )存储引擎。


Since MySQL uses BTREE by default when creating an index, is there some instance when I can use HASH? For example, if my table only consists of Foreign Keys which are just INT UNSIGNED values. Is it a good improvement to override BTREE with HASH in this case?

Not sure if it matters, but I'm using InnoDB.

解决方案

The HASH index type is only supported for MEMORY (aka HEAP) storage engine.

这篇关于MySQL何时可以使用HASH而不是BTREE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆