Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Why function-based index cound't work with OR-expansion
Hi,
I see the function-based index restrictions from otn
link,http://www.oracle.com/pls/db92/print_hit_summary?search_string=Restrictions+for+Function-Based+Indexes
Function-based indexes are not used when OR-expansion is done.
for example:
If use OR-expansion, the sql always does full table scan and ignore the
b-tree index on instr_sedol_id = :b1 and function-based index on UPPER
(instr_ric_id) .
SQL> explain plan for select * from instrument WHERE UPPER (instr_ric_id) = :b0 or instr_sedol_id = :b1;
Explained.
SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
PLAN_TABLE_OUTPUT
Then try union and it works.
SQL> explain plan for select * from instrument WHERE UPPER
(instr_ric_id) = :b0 union select * from instrument WHERE
instr_sedol_id = :b1;
Explained.
PLAN_TABLE_OUTPUT
|* 4 | INDEX RANGE SCAN | INSTRUMENT_FB1 | 1000 | | 1 |
Is there anything difficult for Oracle kernel to implement this feather?
Thanks,
Steven
Received on Sun Jan 15 2006 - 18:44:30 CST
![]() |
![]() |