设为首页 加入收藏

TOP

[MySQL] explain中的using where和using index
2019-08-23 00:37:19 】 浏览:39
Tags:MySQL explain using where index

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过滤

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇个人博客制作如何选择前端模板 th.. 下一篇PHP结合zyupload多功能图片上传实..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目