RE: set optimizer_features_enable to lower version SQL run faster?

From: Mark W. Farnham <>
Date: Wed, 3 Feb 2010 03:07:55 -0500
Message-ID: <>

If these are stock queries, then do an explain plan of the fastest one. Then clone the query and hint it or do whatever else you need to do to get the same plan in your current release, and do whatever is the equivalent of a stored outline for your current release.

Keep a list of which queries have been thus tinkered with and give each a chance with natural plan creation at each new release (hoping to remove it from the "tinkered with" list.)

If the "whatever else you need to do" includes tinkering with init parameters or session parameters, consider carefully whether the changes from defaults are overall positive for your instance that executes the query and record that you made the changes and why (again with the notion to at least give defaults a try as time allows after upgrades or optimizer oriented patches.)

Also, as time allows, examine whether the query was optimized for older release optimizers in a way that prevents a newer optimizer from generating a possibly better plan and consider recasting the query "naturally" to see whether the newer optimizer can do better.

If these are generated queries or dynamic or ad hoc queries you have a tricker job do to and the possibilities are np incomplete.

There has been somewhat of a trend toward more "hash" based plans as you move ahead in releases. You may need to allocate more room in memory areas for those plans to operate reasonably. The explain plans from the different releases will give you an idea whether this is a potential problem for your actual case.

I hope this brief process outline helps you a bit.

-----Original Message-----

From: [] On Behalf Of dba1 mcc
Sent: Tuesday, February 02, 2010 6:09 PM To:
Subject: set optimizer_features_enable to lower version SQL run faster?

we have ORACLE enterprise version on LINUX. recently we found some SQL statemnets run very slow (even we run analyze statistics). But if we set optimizer_features_enable to lower version it run much faster. Following is data we got:

When the SQL is run with OPTIMIZER_FEATURE_ENABLE= 73 seconds 50 seconds

 9 30 seconds

 8 1 second.

  1. does there has some way we can do (NOT set optimizer_features_enable to lower version) still get better SQL performance?
  2. if unfortunately we need set 'optimizer_feature_enable to lower version like 8.0) does database will have any problem?



-- Received on Wed Feb 03 2010 - 02:07:55 CST

Original text of this message