Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: oracle-l Digest V3 #147

Jonathan Lewis

2006-05-23


----- Original Message -----
> Date: Mon, 22 May 2006 14:27:56 +0200 (MEST)
> From: "Milen Kulev" <makulev@(protected)>
> Subject: RE: 54 is less than 4 for CBO ?
>
> In the 10053 event file I see the following lines (with
> optimizer_mode=FIRST_ROWS_1)
> First K Rows: K/N ratio = 0,000001091131285, qbc=11020ea80
> First K Rows: Setup end
>
>
>
> And now the next bacth of questions (conserning "alter session set
> optimizer_mode=FIRST_ROWS_1" ):
>
> 1)Where the digit
> First K Rows: K/N ratio = 0,000001091131285, qbc=11020ea80
> is coming from ?
>
> 2) Why the FTS cost on T_FZG_SA is only 2 ? How this value is calculated
>

Roughly speaking:

1) Oracle calculates the expected cardinality N of the final
result and produces a fraction that represents your intention
of returning 1/N of the rows - this would be 10/N, 100/N
etc. if you used first_rows_10, first_rows_100.

2) Given that you want 1/N th of the data, then you need
only do 1/Nth of the driving table scan to get enough data
in that step to continue to the next step. Allow for some
rounding errors, and oddly placed 'plus 1'.



Regards

Jonathan Lewis
http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html


--
http://www.freelists.org/webpage/oracle-l


©2008 dba.5341.com - Jax Systems, LLC, U.S.A.