Use index with a OR
Hi,
Here is the test case :
create table test1(c1 number, c2 varchar2(30),c3 number,c4 varchar2(30));
insert into test1 values(1,'test1',11,'');
insert into test1 values(2,'test2',22,'t2');
insert into test1 values(3,'test3',33,'');
insert into test1 values(4,'test4',44,'t4');
insert into test1 values(5,'test5',55,'');
insert into test1 values(6,'test6',66,'');
insert into test1 values(7,'test7',77,'t7');
insert into test1 values(8,'test8',88,'');
commit;
create index test1_c4_idx on test1(c4);
exec dbms_stats.gather_table_stats(ownname=>'USERA',tabname=>'TEST1',cascade=>true);
select * from test1 where (c4=:test or :test is null);