Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: No stats, why the heck is CBO running???

Re: No stats, why the heck is CBO running???

From: <J.Velikanovs_at_alise.lv>
Date: Tue, 20 Jul 2004 18:03:30 +0300
Message-ID: <OFEC90A2A4.6F4C0AA1-ONC2256ED7.00523167-C2256ED7.00537006@alise.lv>


It is quite interesting, that Oracle require to gather statistics on DD within Apps environment:



Metalink Note 216550.1
“Interoperability Notes Oracle Applications Release 11i with Oracle9i Release 2 (9.2.0)”
step 18 Gather statistics for SYS schema

.
However doesn’t recommend in general:

Metalink Note 245051.1
“Gathering Data Dictionary Statistics”
Gathering statistics on the Data Dictionary in Oracle9i is a supported activity.
In the majority of cases, gathering Data Dictionary statistics should not be
necessary (and would not normally be recommended) since the dictionary has been optimized to cater for most common database setups.

.
:)
Jurijs
9268222

http://otn.oracle.com/ocm/jvelikanovs.html

Tanel Põder <tanel.poder.003_at_mail.ee>
Sent by: oracle-l-bounce_at_freelists.org
20.07.2004 17:50
Please respond to oracle-l  

        To:     <oracle-l_at_freelists.org>
        cc: 
        Subject:        Re: No stats, why the heck is CBO running???


> Yet a simple query to find the "next extext that wont fit" is always
using
the CBO???
>
> This SQL queries DBA_TABLES and DBA_FREE_SPACE. There are NO hints in
the
SQL.
>
> What the heck?

But there are hints in DBA_FREE_SPACE:

SQL> select text from dba_views where view_name = 'DBA_FREE_SPACE';

TEXT




select ts.name, fi.file#, f.block#,
       f.length * ts.blocksize, f.length, f.file#
from sys.ts$ ts, sys.fet$ f, sys.file$ fi
where ts.ts# = f.ts#

  and f.ts# = fi.ts#
  and f.file# = fi.relfile#
  and ts.bitmapped = 0
union all
select /*+ ordered use_nl(f) use_nl(fi) */
       ts.name, fi.file#, f.ktfbfebno,
       f.ktfbfeblks * ts.blocksize, f.ktfbfeblks, f.ktfbfefno
from sys.ts$ ts, sys.x$ktfbfe f, sys.file$ fi where ts.ts# = f.ktfbfetsn
  and f.ktfbfetsn = fi.ts#
  and f.ktfbfefno = fi.relfile#
  and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0

These kind of issues are one of the reasons why one should avoid putting hints inside views...

Now, when you join several unanalyzed tables with one analyzed one, CBO will
be used by default and default statistics will be used for unanalyzed tables
(or dynamic sampling depending on optimizer_dynamic_sampling parameter).

Tanel.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jul 20 2004 - 10:08:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US