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

 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
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

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

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Fixing different execution plans with different bind variable values

Oracle Database Tips by Donald BurlesonMay 17, 2015

Question:  I have a table column with highly skewed values where 80% of the values are for one.  I created a histogram and verified that the histogram exists, but the SQL execution plan does not switch between table access full and index access. 

What can I do to make the execution plans change?  It's a vendor package on Oracle 10g.

Answer:  On Oracle10g bind variable peeking does not work until well until Oracle 11g's adaptive cursor sharing.  There are several options:

  • Try cursor_sharing=similar - There may be bugs, so check MOSC.  Also see these notes on cursor_sharing=similar:

  • Build a specialized index - You can create an index with a CASE statement that only indexes the unpopular values.  It's similar to the technique of indexing on NULL values, but you create a function-based index using a CASE statement to filter out the popular value.  You can also index on regular expressions, to make an index with only the unpopular values.

Note:  For testing purposes, you may want to turn-off optimizer bind variable peeking and this can be done in several ways::

  • Re-set the _optim_peek_user_binds hidden parameter.

  • Re-analyze using dbms_stats with the argument:  method_opt=> 'for all columns size 1';

Also, see my notes on dealing with execution plan changes with bind variables:

SQL explain plan does not match execution statistics



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.