Oracle: select 优化问题
select * from table1 where id=:xx;
select * from table1 where id=:xx or :xx is null;
id是索引列,因此第一句极快;然而第二句非常慢,由于实际情况where中还有很多复杂的条件,我不想改写成:
select * from table1 where id=:xx
union all
select * from table1 where :xx is null;
有没有办法解决?
另:hint 如何使用?

