简单的sql优化
避免where中出现or
select id from table where num=10 or num=20
select id from table where num=10
union all
select id from table where num=20
查询时避免使用in和not in
连续数值
select id from table where num in(1,2,3)
select id from table where num between 1 and 3
应尽.
原创
2020-09-10 10:09:16 ·
202 阅读 ·
0 评论