响应式网站怎么样深圳市手机网站建设企业
响应式网站怎么样,深圳市手机网站建设企业,网站源码系统,wordpress优雅的暂停覆盖索引#xff1a;查询使用了索引#xff0c;并且需要返回的列#xff0c;在索引里面都可以找到#xff0c;减少select*的使用
1、using index condition
Extra 为using index condition 表明查找使用了索引#xff0c;但是需要回表查询#xff08;也就是先二级索引查询使用了索引并且需要返回的列在索引里面都可以找到减少select*的使用
1、using index condition
Extra 为using index condition 表明查找使用了索引但是需要回表查询也就是先二级索引拿到id在返回表里面进行聚集索引得到一行的数据耗时耗内存
举个例子
explain select * from tb_user where name码云 and phone18800008888 and age55;
explain select id, name, phone,age,gender from tb_user where name码云 and phone18800008888 and age55;2、using where, using index
Extra为 using where, using index表明查找使用了索引但是需要的数据在索引里面都可以找到不需要回表查询
举个例子
explain select id, name, phone from tb_user where name码云 and phone18800008888 and age55;
explain select id, name, phoneage from tb_user where name码云 and phone18800008888 and age55;总结尽量不要使用select*,容易出现回表查询降低查询效率除非联合索引包含了所有的字段。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/89678.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!