Oracle谓词推入

创建测试数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
drop table t1;
drop table t2;
drop table t3;

create table t1(n1 number,n2 varchar2(200));
create table t2(n1 number,n2 varchar2(200));
create table t3(n1 number,n2 varchar2(200));

insert into t1 select object_id,object_name from dba_objects;
insert into t2 select object_id,object_name from dba_objects;
insert into t3 select object_id,object_name from dba_objects;
commit;

create index idx_t1 on t1 (n2);
create index idx_t2 on t2 (n2);
create index idx_t3 on t3 (n2);

exec dbms_stats.gather_table_stats(ownname=>'XB',tabname=>'T1',cascade=>true);
exec dbms_stats.gather_table_stats(ownname=>'XB',tabname=>'T2',cascade=>true);
exec dbms_stats.gather_table_stats(ownname=>'XB',tabname=>'T3',cascade=>true);
阅读更多