1. 问题描述
MySQL 包含的索引类型主要包括 Btree、Hash、FullText 和 Rtree,经常使用的主要是 Btree 和 Hash 两种索引。
通过 DMS 登录 RDS 实例后,执行 DDL 语句可以在 InnoDB 引擎表上创建 Hash 类型的索引,如图:
drop
table
if
exists auth_order;
create
table auth_order (
id
smallint
not
null
comment
'主键',member_id
varchar(
30)
not
null
comment
'会员id',
name
varchar(
100)
not
null
comment
'名称',primary
key (
id),
key auth_mem_name (member_id)
using
hash)
engine=
innodb
default
charset=utf8
comment=
'会员信息';
[/url]
2. 问题原因
由于 MySQL InnoDB 引擎不支持 Hash 索引,而 MySQL 服务层是有 Hash 索引选项的,因此建表语句可以使用子句 Using Hash,而实际创建的索引类型仍然是 Btree 类型的索引。
如果问题还存在,请联系[url=https://selfservice.console.aliyun.com/ticket/createIndex.htm]阿里云售后支持。