• 学派吧-由新云网络独家赞助-https://www.sq9.cn。

在MySQL中的explain中的using where和using index-mysql教程-

MySQL admin 5年前 (2019-04-24) 2397次浏览 已收录 0个评论 扫描二维码

本篇文章的主要内容是关于在mysql数据库explain中的using where和using 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过滤

推荐课程:mysql视频教程

以上就是在MySQL中的explain中的using where和using index的详细内容,更多请关注php中文网其它相关文章!


学派吧 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:在MySQL中的explain中的using where和using index-mysql教程-
喜欢 (0)
[pay@sq9.cn]
分享 (0)
关于作者:
腾讯云-运维运维 QQ 690624
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址