sql语句or与union all的执行效率哪个更高
如题
第一种写法:
with pagelist as (
select * from table where table_column=1
union all
select * from table where table_column=2
)
select * from pagelist
第二种写法:
with pagelist as (
select * from table where table_column=1 or table_column=2
)
select * from pagelist
请教下,以上两种写法,哪个效率更高些,为什么?