原SQL:
select * from table where column1 = '4' or column2 = '0'
优化后:
select * from table where column1 = '4'
union all
select * from table where column2 ='0' and column1 !='4'
原SQL:
select * from table where column1 = '4' or column2 = '0'
优化后:
select * from table where column1 = '4'
union all
select * from table where column2 ='0' and column1 !='4'
本文标题:MySQL优化OR
本文链接:https://www.haomeiwen.com/subject/zfceoltx.html
网友评论