【发布时间】:2015-10-16 21:28:57
【问题描述】:
查询:
SELECT A from table_name where A = 'a';
解释输出
1 SIMPLE table_name ref A_idx A_idx 1 const 40582635 **Using where; Using index**
问题
我有一个复合索引A_idx on (A,B,C)...
我希望输出仅使用索引,因为索引涵盖了完整的查询。但我仍然得到一个 using where;使用索引...
有问题的列是具有以下定义的 ENUM。
A enum('a','b','c') COLLATE utf8_unicode_ci NOT NULL,
【问题讨论】:
-
显然我什至得到这个..如果我这样做
select id from table where id > 100.... -
让我们以不同的方式检查。你从
FLUSH STATUS; SELECT ... ; SHOW SESSION STATUS LIKE 'Handler%';得到什么?表格中有多少行? -
我会这样做并尽快分享结果
-
在bugs.mysql.com 提交错误。
标签: mysql optimization indexing innodb b-tree