use the function_based index to access the null value

wmlm發表於2007-05-31

select .... from ... where lxr is null;

this statement can't use the idnex!!!


[@more@]

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部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-916958/,如需轉載,請註明出處,否則將追究法律責任。

相關文章