Re: Keep CBO plan stable(plan stability)

  • From: zhu chao <zhuchao@xxxxxxxxx>
  • To:
  • Date: Thu, 13 Oct 2005 23:01:27 +0800

I tried level 3. Oracle is , and optimizer_feature_enable=9.2
SQL is not complicated, just like:
select a.col1, col2,b.col3,b.col4 from user_info a, users b where
in (:b1,:b2,...,b25) and;

There is index on, Correct plan used index scan and
then NL join a,b.
While wrong plan used index scan, and then b.FTS, and then Hash join.

The key problem I don't understand is, why oracle changed the plan ,
when there is no statistics there. (from your comments, it should read
from segment header for the NLBK, others remaining unchanged). But
seems what the trace file reflect does not show the the correct number
of blocks.

Also I want to know:
If we do keep have the statistics for CBO, and after some time's
running we feel satisfied with current execution plan/database
performance, we don't analyze any table again (to keep the plan
stable, even with data distribution change, we want to reuse current
plan), will CBO keep the plan unchanged afterwords? of course other
things like optimizer related parameter does not change.
My manager want to use stored outline, while it is very troublesome to
maintain outline when there is a lot of database, I am trying to reach
this goal with minimum workload.

On 10/13/05, Lex de Haan <> wrote:
> depends on the version.
> in 9i, the default is dynamic sampling at level 1; in 10g, it is level 2
> (because in 10g the RBO is obsoleted.) which level did you try?
> how does the actual statement look like? do you have a complicated where
> clause? just trying to guess why the CBO would choose for bitmap
> conversion. sometimes that is quite smart, sometimes it isn't ...
> cheers,
> Lex.
Zhu Chao

Other related posts: