#创建一个表
create table test02
(
a1 char(3),
a2 char(3),
a3 char(3),
);
#给表加上联合索引
alter table test02 add index idx_a1_a2_a3 (a1,a2,a3) ;
按照最佳左前缀原则,相当于上面的表只存在(a1)、(a1、a2)、(a1,a2,a3)这三个索引
其实是没有单独的(a3)索引,也不存在(a2,a3)
但是执行explain select a3 from test02 where a3= '' ;却发现用到了该联合索引,我想问的问题是最佳左前缀是不是错的!!!!