开发者社区> 问答> 正文

技术运维问题 - MYSQL使用 - RDS MySQL InnoDB 引擎表索引类型更改为 Hash 后无效




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]阿里云售后支持

展开
收起
梨好橙 2018-09-18 00:09:48 2017 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像