select .... from ... where lxr is null;
this statement can't use the idnex!!!
grant query rewrite to scott;
alter system set query_rewrite_enabled=true; --the default is false
alter system set query_rewrite_integrity=trusted; -- the default is enforced
create index idx_c_khxx_zb_lxr on c_khxx_zb(case when lxr is null then 1 end);
-- alter the index created, gather the table's stats
begin
dbms_stats.gather_table_stats(user,'C_KHXX_ZB',cascade=>true);
end;
/
set autotrace traceonly explain (if not , system @rdbms/admin/utlxplan.sql)
select * from emp.......
set autotrace off
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-916958/ ,如需转载,请注明出处,否则将追究法律责任。