可以看出如果in和or所在列有索引或者主键的话,or和in没啥差别,执行计划和执行时间都几乎一样。如果in和or所在列没有索引的话,性能差别就很大了。在没有索引的情况下,随着in或者or后面的数据量越多,in的效率不会有太大的下降,但是or会随着记录越多的话性能下降非常厉害,从第三中测试情况中可以很明显地看出了,基本上是指数级增长。
mysql 查询or 和in 哪个更优
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
高效的PHP邮件发送库:Swiftmailer
木子耗2009
2020-06-23 03:03:24
php 系统 自带的error_log函数来记录日志
error_log('Line ' . $line . '; time ' . time() . '; ' . $msg . "\n", 3, $this->LogFile);
木子耗2009
2020-06-23 03:03:24
facebook ZuckMail
木子耗2009
2020-06-23 03:03:24
免费开源的邮局
https://www.bt.cn/bbs/thread-32749-1-1.html postfix(作爲發送郵件服務器)+dovecot(作爲接收郵件服務器)+mysql(作爲數據庫)
木子耗2009
2020-06-23 03:03:24
liunx curl 模拟post请求
curl https://www.xxx.com/api/batch/validate -X POST -d 'usr=xx&pwd=xx&[email protected]'
木子耗2009
2020-06-23 03:03:23
php current()失效
木子耗2009
2020-04-11 05:09:58
高效的PHP邮件发送库:Swiftmailer
木子耗2009
2020-06-23 03:03:24
php 系统 自带的error_log函数来记录日志
error_log('Line ' . $line . '; time ' . time() . '; ' . $msg . "\n", 3, $this->LogFile);
木子耗2009
2020-06-23 03:03:24
facebook ZuckMail
木子耗2009
2020-06-23 03:03:24
免费开源的邮局
https://www.bt.cn/bbs/thread-32749-1-1.html postfix(作爲發送郵件服務器)+dovecot(作爲接收郵件服務器)+mysql(作爲數據庫)
木子耗2009
2020-06-23 03:03:24
liunx curl 模拟post请求
curl https://www.xxx.com/api/batch/validate -X POST -d 'usr=xx&pwd=xx&[email protected]'
木子耗2009
2020-06-23 03:03:23
php current()失效
木子耗2009
2020-04-11 05:09:58
CA 解密系统原理及流程
Kallen
2020-02-25 22:17:41
中海油基于IBM FileNet P8构筑海外业务管理系统
fuwaer
2018-09-04 08:36:03
IBM ECM平台助力泰康人寿集约化经营
fuwaer
2018-09-04 08:36:02