Re: Optimizer issue in 11g

From: Randolf Geist <>
Date: Thu, 4 Feb 2010 13:49:13 -0800 (PST)
Message-ID: <>

On Feb 3, 7:48 am, amy <> wrote:
> We have queries that have been completing in minutes for months in
> We did verify that the statistics on the tables and indexes involved
> have not been reanalyzed and the stats remained the same since the
> last good run but yet the access path has changed. If everything
> remains the same, ie stats, init.ora parameters, could an access path
> changed? What else could influence the Optimizer?

That is indeed an interesting question. There are a couple of ideas how this could happen, some of them have already been mentioned here:

  • Bind variable peeking (as mentioned by Jonathan): But you say that queries are affected that do not use bind variables
  • Dynamic Sampling: This could be verified by checking the "Notes" section of the DBMS_XPLAN.DISPLAY_CURSOR/AWR output for the queries in question. Note that depending on the level of Dynamic Sampling used you can get Dynamic Sampling even with statistics in place (starting with Dynamic Sampling at cursor/session/system level 3)
  • Re-gathered System Statistics: If you re-gather System Statistics, the plans might change without changes to the object statistics
  • Usage of SQL Profiles / SQL Baselines: If you have a suitable license (Enterprise Edition + Tuning Pack) you could have configured the automatic execution of the SQL Tuning Advisor to accept SQL Profiles automatically, which in case of existing SQL Baselines also includes the automatic evolution of unaccepted SQL Baselines. Again both (Usage of SQL Profiles / SQL Baselines) can be checked in the "Notes" section, where it will be indicated if the plan uses a SQL Profile or Baseline. See e.g. Christian Antognini's blog post about this topic:
  • Adaptive Optimisation: I don't think that this feature is already there in 11.1 (enabled in 11.2) - this would be another obvious explanation - of course this feature is supposed to improve estimates of the optimizer, but who knows. Again this could be checked via the "Notes" section ("Cardinality Feedback used"). For more information:
  • Optimizer Bug: You might hit a bug in the optimizer code


Oracle related stuff blog:

Co-author of the "OakTable Expert Oracle Practices" book: Received on Thu Feb 04 2010 - 15:49:13 CST

Original text of this message