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 


 

 

 


 

 

 
 

Why doesn't Oracle use my index?

Oracle Database Tips by Donald BurlesonMay 25, 2015

Question:  I have a SQL query where Oracle is not using an index.  The explain plan shows TABLE ACCESS FULL.  I verified that the index exists, but I cannot seem to force Oracle to use the index.  Why does Oracle ignore an index?  How do you force an index to be used?

Answer:  The Oracle cost-based optimizer carefully evaluates every query when making the decision whether to invoke a full-table scan or index access, and you can force index usage with in index hint.  The goal of the SQL optimizer is to only force an index when it's the "best" access plan, given your optimization goals:


Some of the variables that influence the decision to force or ignore an index include:

  • The number of blocks in the table - Small tables are accessed faster with a full scan and forcing index usage may hurt performance.
     
  • System statistics - the dbms_stats.gather_system_stats procedure measures external timing for index access (sequential reads) and full-scan access (scattered reads).  If Oracle sees expensive index disk reads, it may ignore an index.
     
  • Optimizer parms - You can adjust several optimizer parms to force Oracle to use an index:

optimizer_mode - The all_rows access method often favors a parallel full-table scan over an index scan. The first_rows optimizer_mode will often stop Oracle from ignoring an index because it favors index access over computing resources.

optimizer_index_cost_adj - This parameter alters the costing algorithm for access paths involving indexes. The smaller the value, the lower the cost of index access.

sort_area_size (if not using pga_aggregate_target) - The sort_area_size influences the CBO when deciding whether to perform an index access or a sort of the result set. The higher the value for sort_area_size, the more likely that a sort will be performed in RAM, and the more likely that the CBO will favor a sort over presorted index retrieval.

 See these related notes on forcing Oracle to use an index:

 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

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 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.