No Richard is right. NO stats implies the RBO, stats on any one of the
are one IO in size). Thus stats on one table is likely worse than no stats.
introduced after the RBO was frozen.
> First, I'm sorry for my poor english... I'm french ;)
> Then, yes, all tables have been analyzed, but with estimate.
> I will try again with compute all!
> Finaly, I think that your last sentence must be "If just one table has
> > then CHOOSE will use the RBO."? :)
> Thanks for all!
> "Richard Foote" <richard.fo...@bigpond.com> a crit dans le message news:
> > Hi
> > But your previous statement "but is CBO not supposed, when no stats,
> > at least that indexes exist on tables?" (poorly written as it is)
> > support your statement that you know all that !! No stats, Oracle makes
> > assumption tables are small, FTS most efficient way to access such
> > Question and we need a clear answer on this. Have you analyzed ALL the
> > tables in this query of yours ? If you haven't then based on my little
> > lesson (glad you liked it) FTS are to be expected and poor execution
> > and poor performance is to be expected as well. If just one table has
> > then CHOOSE will use the CBO.
> > Trying to help :)
> > Richard
> > "Epicentre Team B Annecy" <carma...@epicentre.fr> wrote in message
> > news:firstname.lastname@example.org...
> > > Hi Richard!
> > > I know all of that!!
> > > However, the query which explain plan is in my first message
> > > run very faster with RBO than with CBO, and THAT is my "problem"!
> > > ... As I know that FTS is better than use of an index with poor
> > > selectivity... ;-)
> > > I thank you all the same for this lesson, I am sure that it can take
> > > advantage to somebody!
> > > Cordially.
> > > "Richard Foote" <richard.fo...@bigpond.com> a crit dans le message
> > > 9bTY8.36123$Hj3.107...@newsfeeds.bigpond.com...
> > > > Hi Epicentre Team B Annecy,
> > > > You are making a common but often erroneous assumption that the use
> > an
> > > > index is *always* better than a FTS. Fortunately the CBO does not
> > > this
> > > > assumption, hence why indexes may not be used.
> > > > Now I have always had a soft spot for the little battler and I an
> > official
> > > > member of the "Hey, Stop Picking On The Poor FTS, It's A Better
> > > Path
> > > > Than Many Give It Credit For Society", or HSPOTPFTSIABAPTMGICFS or
> > > :)
> > > > A few key points.
> > > > If by accessing an index to read x number of rows is *more
> > than
> > > > to use a FTS, then a FTS my friend is the way to go. The FTS has
> > > > really really big advantages over an index.
> > > > 1) A conventual read of an index can *only* access data one block at
> > > time.
> > > > Each read of an index block, one logical I/O, each subsequent access
> > > the
> > > > table, one logical I/O. A FTS can read multiple blocks in one I/O.
> > is
> > > > set (and tuned) via the db_file_multiblock_read_count parameter but
> > > say
> > > > it's set to 8. This means it can effectively read the table in
> > > under
> > > > the HWM/8' logical I/Os. Very important point.
> > > > 2) Each block in a table is only ever accessed *once* during a FTS.
> > > > accessing via an index, a bock may be visited many times (up to the
> > number
> > > > of rows that reside in the block). Each time it needs to be
> > is
> > > an
> > > > additional logical I/O. In theory, if you were to read every row via
> > > > index, the number of logical I/Os would be 'the majority of blocks
> > the
> > > > index + the number of rows in the table'. Very important point. A
> > > > remember 'number of *blocks*/8'
> > > > 3) A FTS can be performed in parallel while a conventual index scan
> > > not.
> > > > Assuming we have an effective degree of parallelism of 8, this means
> > > can
> > > > read an entire table in approximately the same time it takes an
> > > > read 'number of blocks/8/8' I/Os. Very very important point.
> > > > The question the CBO asks is what is the break even point. At what
> > > is
> > > > it more efficient to use an index, at what point is it more
> > > > read the whole damn lot. This of course depends. Not so much on the
> > > > 'percentage of rows' that need to be accessed, but more so on the
> > > proportion
> > > > of 'blocks' that one method uses over the other based on the above
> > > > points.
> > > > If accessing one row, then the cost of the index is say root
> > block+branch
> > > > block+ leaf block in the index + one data block. Four logical I/Os
> > > (although
> > > > the CBO might be clever enough to assume some of the index blocks
> > > > already be in memory). To read the table via FTS is say 1000 table
> > blocks
> > > /8
> > > > or 125 logical I/Os hence the index wins.
> > > > To read say 10/% of the table requires say, one leaf block+one
> > > block+
> > > > say 100 leaf blocks + say 1000 table blocks (ie. approx 10 rows per
> > block)
> > > > which equals 1102 logical I/Os. To read the table via FTS is say
> > > tables
> > > > blocks / 8 or 125 logical I/Os (again). Hence, FTS wins and wins
> > > > If tables are not analyzed (and therefore Oracle has no statistics)
> > > can
> > > > Oracle compute the above calculations. It can't. In fact what Oracle
> > does,
> > > > is assume the tables are really small, tiny, not deserving of
> > statistics.
> > > So
> > > > small in fact that they can be read with one logical I/O (ie. are
> > > than
> > > > the db_file_multiblock_read_count of blocks). *Note one logical I/O
> > > read
> > > > this table* (which is far better than 2 logical I/O that the best
> > > can
> > > > offer !!). That's why the CBO ignores indexes on non analyzed
> > > > So in summary, although you say the CBO is not using the indexes and
> > that
> > > it
> > > > should be aware of them, note it *is* aware of them but it
> > that
> > > > it's less expensive to read the whole table anyway.
> > > > I could go on but I hope this all makes sense and helps in your
> > > > understanding of what might be going on.
> > > > Good Luck
> > > > Richard
> > > > "Epicentre Team B Annecy" <carma...@epicentre.fr> wrote in message
> > > > news:email@example.com...
> > > > > I know the influence of statistics for CBO,
> > > > > and I know that when no stats, CBO makes join from left to right
> > > > > in the FROM clause,
> > > > > but is CBO not supposed, when no stats, knowing at least that
> > > > exist
> > > > > on tables?
> > > > > Thanks again.
> > > > > "Loadrunner" <l...@runner.com> a crit dans le message news:
> > > > > 1026810930.9839.0.nnrp-10.c2d92...@news.demon.co.uk...
> > > > > > Can you confirm that you have analyzed tables with the "For
> > For
> > > > All
> > > > > > Columns For All Indexes" clause?
> > > > > > If very large table estimate the statistics.
> > > > > > The explain plan produced when CBO active can vary dramatically
> > > or
> > > > > > without statistics.