永洪社区

标题: 这里写子查询也没有走索引,加了子查询反而更慢 [打印本页]

作者: 15018397438    时间: 2023-1-4 15:29
标题: 这里写子查询也没有走索引,加了子查询反而更慢
永洪的sql应该怎么优化,提高查询速度,页面查询慢

作者: yhdata_yzm    时间: 2023-1-4 15:39
那你还是走索引呗
作者: 15018397438    时间: 2023-1-4 16:38
yhdata_yzm 发表于 2023-1-4 15:39
那你还是走索引呗

索引使用betwee 日期1 and  日期2才能有效果,between 。。。 and。。。 和 stat_date>=date1 and stat_date <= date2 出来数据一样吗
作者: yhdata_ruby    时间: 2023-1-4 16:45
15018397438 发表于 2023-1-4 16:38
索引使用betwee 日期1 and  日期2才能有效果,between 。。。 and。。。 和 stat_date>=date1 and stat_d ...

这两个一样的
作者: 15018397438    时间: 2023-1-4 17:18
yhdata_ruby 发表于 2023-1-4 16:45
这两个一样的

但是between and 日期范围大也不走索引了,有没有什么办法可以解决呢




欢迎光临 永洪社区 (http://club.yonghongtech.com/) Powered by Discuz! X3.4