1、假设index(a,b,c)
where语句索引是否被使用where a =3Y,使用到awhere a =3 and b =5Y,使用到a,bwhere a =3 and b =5 and c =4Y,使用到a,b,cwhere b =3 或者 where b=3 and c=4 或者 where c=4Nwhere a =3 and c=5使用到a,但是c不可以,因为b中间断了where a =3 and b>4 and c=5使用到a和b,c不能用在范围之后,因为b断了where a =3 and b like ‘kk%’ and c =4a能用,b能用,c不能用MySQL高级——索引优化总结示例
关注
打赏