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

本篇文章的主要内容是关于在mysql数据库explain中的using where和using index的使用,感兴趣的朋友可以了解一下。

1. 查看表中的所有索引 show index from modify_passwd_log; 有两个 一个是id的主键索引 , 一个是email_id的普通索引

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

2. using index表示 使用到了索引 , 并且所取的数据完全在索引中就能拿到

explain select email_id from modify_passwd_log where email_id=670602;

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

3. type是ref,where是空白:使用到了索引,但是查询的数据有没在索引中的,回表去拿数据了

explain select * from modify_passwd_log where email_id=670602;

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

4. type是ref , where是 using where ,表示使用到了索引 , 但是也进行了where过滤

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

推荐课程:mysql视频教程

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

主题测试文章,只做测试使用。发布者:云大使,转转请注明出处:https://www.xp8.net/data/3573.html

(0)
打赏 微信扫一扫 微信扫一扫
云大使的头像云大使
上一篇 2019年4月24日 下午11:26
下一篇 2019年4月24日 下午11:26

相关推荐

发表回复

登录后才能评论
联系我们

联系我们

18838889666

在线咨询: QQ交谈

邮件:xinyun@88.com

工作时间:周一至周五,9:30-18:30,节假日休息

添加微信
添加微信
分享本页
返回顶部
---------官方优惠叠加渠道折扣:通过我们购买腾讯云/阿里云,价格更低,服务更优。更有专业配置指导与服务。微信同步:18838889666----