1
create table t1 (c1 int, c2 int, c3 int, c4 int, primary key(c1));
2
create index i1 on t1 (c2);
3
create index i2 on t1 (c3, c4);
4
create index i3 on t1 (c3) storing(c4);
5
replace into t1 values (1,1,2,1),(2,2,1,null),(3,3,null,null),(4,null,null,null);
12
select /*+ index(t1 i2) */ * from t1 where c3=1;
15
select * from t1 where c3=1;
18
select /*+ index(a1 i2) */ * from t1 as a1 where c3 in(1,2);
22
select * from t1 as a1 where a1.c3 in (1,2);
26
select /*+ index(t1 primary) */ * from t1 where c3 in(1,2);
30
select * from t1 where c3 is null;
34
select /*+ index(t1 i2) */ * from t1 where c3 is null;
38
select /*+ index(t1 primary) */ * from t1 where c3 is null;
42
select /*+ index(t1 i4) */ * from t1 where c3 is null;