Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Oracle Analyze Function-Based Index Ignored or Not Working

Oracle Database Tips by Donald BurlesonConsulting

June 29, 2015

Question:  I have created a function-based index on a table column, yet when I check by execution plan, the function-based index is ignored by the optimizer.

Why does Oracle ignore a function-based index? 

How do I force Oracle to use a function-based index?

Answer: :  The optimizer is aware of all indexes at index creation time, but you still must analyze the function-based index, else the optimizer may ignore the index.  

The most common problem when a function-based index is ignored is when the DBA has forgotten to analyze the function-based index.  After creating a function-based index, you want to re-gather table statistics and get extended statistics on the function.

In this case we create a function-based index and then analyze using the method_opt argument set to FOR ALL HIDDEN COLUMNS.

 Create an FBI on emp_nbr column with NULL values

create index
     emp_null_emp_nbr_idx
on
    emp
    (nvl(ename,o));

To make the function-based index work, we must now analyze the index.  Depending on your release, these methods are appropriate:

EXEC DBMS_STATS.gather_index_stats('EMP', 'emp_null_emp_nbr_idx');

exec dbms_stats.gather_table_stats(
    ownname=>null,
    tabname=> 'EMP',
    estimate_percent=>null,
    cascade=>true,
    method_opt=> 'FOR ALL HIDDEN COLUMNS SIZE 1′
);

In Oracle 11g and beyond, Oracle recommends analyzing "extended" statistics on function-based indexes:

begin
   dbms_stats.gather_table_stats (
      ownname    => 'SCOTT',
      tabname    => 'EMP',
      method_opt => 'for all columns size skewonly for columns (nvl(ename,o))'  
);
end;

Also see these details on when a function-based index is ignored.

 
Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.

 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2016

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.


 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster