MySQL联合索引最左匹配原则的理解

若是一张表中有a,b,c三个字段索引

创建了联合索引 index(a,b,c)其实至关于建立了index(a),index(a,b),index(a,b,c)三个索引    疑问index(a,c)是否建立了吗?结果发现index(a,c)和index(a)key_len同样。因此没有index(a,c)table

在写SQL时,并不分那个字段在前:select

如: select * from table where a=1 and b=2 and c=3 和 select * from table where b=2 and a=1 and c=3 这两条语句都用了索引index(a,b,c)。tab

相关文章
相关标签/搜索