在MySQL中的explain中的using where和using index【MySQL教程】,mySQL,explain
1. 查看表中的一切索引 show index from modify_passwd_log; 有两个 一个是id的主键索引 , 一个是email_id的一般索引
2. using index示意 运用到了索引 , 而且所取的数据完整在索引中就可以拿到
explain select email_id from modify_passwd_log where email_id=670602;
3. type是ref,where是空缺:运用到了索引,然则查询的数据有没在索引中的,回表去拿数据了
explain select * from modify_passwd_log where email_id=670602;
4. type是ref , where是 using where ,示意运用到了索引 , 然则也进行了where过滤
引荐课程:mysql视频教程
以上就是在MySQL中的explain中的using where和using index的细致内容,更多请关注ki4网别的相干文章!