同一套代码,同一个数据库,线上跑,where条件不生效,本地跑正常,
sql: select a.* from table1 a left join table2 b on a.id=b.userId where a.score > 0
同一套代码,同一个数据库,线上跑,where条件不生效,本地跑正常,
sql: select a.* from table1 a left join table2 b on a.id=b.userId where a.score > 0
首先你要获取不同环境的执行计划再来分析
explain analyze
select a.* from table1 a
left join table2 b
on a.id=b.userId
where a.score > 0
15 回答8.4k 阅读
8 回答6.2k 阅读
1 回答4k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
2 回答3.1k 阅读
1 回答2.4k 阅读✓ 已解决
1 回答2.3k 阅读✓ 已解决
不生效?看日志了吗 打印的sql有where条件吗