<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Comments</title>
	<atom:link href="http://jonathanlewis.wordpress.com/comments-on-comment/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Mon, 20 May 2013 17:10:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/comments-on-comment/#comment-45826</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 07:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=2612#comment-45826</guid>
		<description><![CDATA[Rekha,

This isn&#039;t a forum, so the very least you could do is find a posting which seems to be relevant to your question rather than posting it at random. I will be deleting your question in a couple of days; in the meantime Timur seems to have pointed you to some interesting related information.

You might note that you haven&#039;t included the Oracle version number in your question - and there have been a number of patches, and upgrades even, since the book came out. I believe the book does point out, by the way that the cost of the index-access for a nested loop is reduced by one if the index is unique - and that&#039;s probably part of the change you see. There&#039;s also a sanity check (not mentioned in the book) that limits the total cost of all the accesses into the index - something along the lines of the cost not exceeding the cost of accessing the entire index once, possibly through an index full scan.]]></description>
		<content:encoded><![CDATA[<p>Rekha,</p>
<p>This isn&#8217;t a forum, so the very least you could do is find a posting which seems to be relevant to your question rather than posting it at random. I will be deleting your question in a couple of days; in the meantime Timur seems to have pointed you to some interesting related information.</p>
<p>You might note that you haven&#8217;t included the Oracle version number in your question &#8211; and there have been a number of patches, and upgrades even, since the book came out. I believe the book does point out, by the way that the cost of the index-access for a nested loop is reduced by one if the index is unique &#8211; and that&#8217;s probably part of the change you see. There&#8217;s also a sanity check (not mentioned in the book) that limits the total cost of all the accesses into the index &#8211; something along the lines of the cost not exceeding the cost of accessing the entire index once, possibly through an index full scan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timur Akhmadeev</title>
		<link>http://jonathanlewis.wordpress.com/comments-on-comment/#comment-45744</link>
		<dc:creator><![CDATA[Timur Akhmadeev]]></dc:creator>
		<pubDate>Tue, 27 Mar 2012 09:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=2612#comment-45744</guid>
		<description><![CDATA[Hi

I&#039;ve &lt;a href=&quot;http://timurakhmadeev.wordpress.com/2010/04/15/nl-join-ordered/&quot; rel=&quot;nofollow&quot;&gt;also observed&lt;/a&gt; such behavior some time ago.]]></description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I&#8217;ve <a href="http://timurakhmadeev.wordpress.com/2010/04/15/nl-join-ordered/" rel="nofollow">also observed</a> such behavior some time ago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rekha Singhal</title>
		<link>http://jonathanlewis.wordpress.com/comments-on-comment/#comment-45743</link>
		<dc:creator><![CDATA[Rekha Singhal]]></dc:creator>
		<pubDate>Tue, 27 Mar 2012 08:46:12 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=2612#comment-45743</guid>
		<description><![CDATA[Following is the query on TPC-H schema.

explain plan for select
count(*)
from
        orders,
        lineitem
where
 o_orderkey= l_orderkey.

The trace 10053 (as shown below) for this query shows nested loop join with Lineitem as outer table and Orders as inner table. It is effectively join on composite index (pk_lineitem) of Lineitem and unique index(Pk_orderkey) of Orders table. The cost calculation formula as given in the book as &quot;outer table cost +  cardinality of outer table * inner table cost &quot;  fails here. I am not able to understand this. 

BASE STATISTICAL INFORMATION
***********************
Table Stats::
  Table: LINEITEM  Alias: LINEITEM
    #Rows: 6001215  #Blks:  109048  AvgRowLen:  124.00
  Column (#1): L_ORDERKEY(NUMBER)
    AvgLen: 6.00 NDV: 1500000 Nulls: 0 Density: 6.6667e-07 Min: 1 Max: 6000000
Index Stats::
  Index: LINEITEM_PRTK  Col#: 2
    LVLS: 2  #LB: 12931  #DK: 197757  LB/K: 1.00  DB/K: 29.00  CLUF: 5812082.00
  Index: LINEITEM_SI  Col#: 14
    LVLS: 2  #LB: 29439  #DK: 4  LB/K: 7359.00  DB/K: 109769.00  CLUF: 439077.00
  Index: LINEITEM_SM  Col#: 15
    LVLS: 2  #LB: 18648  #DK: 7  LB/K: 2664.00  DB/K: 112004.00  CLUF: 784030.00
  Index: PK_LINEITEM  Col#: 1 4
    LVLS: 2  #LB: 15440  #DK: 5879916  LB/K: 1.00  DB/K: 1.00  CLUF: 120630.00
***********************
Table Stats::
  Table: ORDERS  Alias: ORDERS
    #Rows: 1500000  #Blks:  24244  AvgRowLen:  110.00
  Column (#1): O_ORDERKEY(NUMBER)
    AvgLen: 6.00 NDV: 1500000 Nulls: 0 Density: 6.6667e-07 Min: 163 Max: 5998114
Index Stats::
  Index: PK_ORDERS  Col#: 1
    LVLS: 2  #LB: 3307  #DK: 1500000  LB/K: 1.00  DB/K: 1.00  CLUF: 24045.00

Join order[2]:  LINEITEM[LINEITEM]#1  ORDERS[ORDERS]#0
***************
Now joining: ORDERS[ORDERS]#0
***************
NL Join
  Outer table: Card: 6001215.00  Cost: 2994.16  Resp: 2994.16  Degree: 1  Bytes: 6
  Inner table: ORDERS  Alias: ORDERS
  Access Path: TableScan
    NL Join:  Cost: 27976374778.51  Resp: 27976374778.51  Degree: 0
      Cost_io: 27873478291.00  Cost_cpu: 2386397111117456
      Resp_io: 27873478291.00  Resp_cpu: 2386397111117456
  Access Path: index (index (FFS))
    Index: PK_ORDERS
    resc_io: 633.55  resc_cpu: 203550602
    ix_sel: 0.0000e+00  ix_sel_with_filters: 1
  Inner table: ORDERS  Alias: ORDERS
  Access Path: index (FFS)
    NL Join:  Cost: 3854751895.27  Resp: 3854751895.27  Degree: 0
      Cost_io: 3802081121.00  Cost_cpu: 1221551742006481
      Resp_io: 3802081121.00  Resp_cpu: 1221551742006481
  Access Path: index (UniqueScan)
    Index: PK_ORDERS
    resc_io: 1.00  resc_cpu: 15293
    ix_sel: 6.6667e-07  ix_sel_with_filters: 6.6667e-07
    NL Join (ordered): Cost: 10714.35  Resp: 10714.35  Degree: 1
      Cost_io: 6722.00  Cost_cpu: 92591405803
      Resp_io: 6722.00  Resp_cpu: 92591405803
  Access Path: index (AllEqUnique)
    Index: PK_ORDERS
    resc_io: 1.00  resc_cpu: 15293
    ix_sel: 6.6667e-07  ix_sel_with_filters: 6.6667e-07
    NL Join (ordered): Cost: 10714.35  Resp: 10714.35  Degree: 1
      Cost_io: 6722.00  Cost_cpu: 92591405803
      Resp_io: 6722.00  Resp_cpu: 92591405803
  Best NL cost: 10714.35
          resc: 10714.35 resc_io: 6722.00 resc_cpu: 92591405803
          resp: 10714.35 resp_io: 6722.00 resp_cpu: 92591405803


Kindly expalin how the cost has been calculated. This does not follow the traditional nested loop cost formula as mentioned in the book.

Thanks
Regards,

Rekha Singhal]]></description>
		<content:encoded><![CDATA[<p>Following is the query on TPC-H schema.</p>
<p>explain plan for select<br />
count(*)<br />
from<br />
        orders,<br />
        lineitem<br />
where<br />
 o_orderkey= l_orderkey.</p>
<p>The trace 10053 (as shown below) for this query shows nested loop join with Lineitem as outer table and Orders as inner table. It is effectively join on composite index (pk_lineitem) of Lineitem and unique index(Pk_orderkey) of Orders table. The cost calculation formula as given in the book as &#8220;outer table cost +  cardinality of outer table * inner table cost &#8221;  fails here. I am not able to understand this. </p>
<p>BASE STATISTICAL INFORMATION<br />
***********************<br />
Table Stats::<br />
  Table: LINEITEM  Alias: LINEITEM<br />
    #Rows: 6001215  #Blks:  109048  AvgRowLen:  124.00<br />
  Column (#1): L_ORDERKEY(NUMBER)<br />
    AvgLen: 6.00 NDV: 1500000 Nulls: 0 Density: 6.6667e-07 Min: 1 Max: 6000000<br />
Index Stats::<br />
  Index: LINEITEM_PRTK  Col#: 2<br />
    LVLS: 2  #LB: 12931  #DK: 197757  LB/K: 1.00  DB/K: 29.00  CLUF: 5812082.00<br />
  Index: LINEITEM_SI  Col#: 14<br />
    LVLS: 2  #LB: 29439  #DK: 4  LB/K: 7359.00  DB/K: 109769.00  CLUF: 439077.00<br />
  Index: LINEITEM_SM  Col#: 15<br />
    LVLS: 2  #LB: 18648  #DK: 7  LB/K: 2664.00  DB/K: 112004.00  CLUF: 784030.00<br />
  Index: PK_LINEITEM  Col#: 1 4<br />
    LVLS: 2  #LB: 15440  #DK: 5879916  LB/K: 1.00  DB/K: 1.00  CLUF: 120630.00<br />
***********************<br />
Table Stats::<br />
  Table: ORDERS  Alias: ORDERS<br />
    #Rows: 1500000  #Blks:  24244  AvgRowLen:  110.00<br />
  Column (#1): O_ORDERKEY(NUMBER)<br />
    AvgLen: 6.00 NDV: 1500000 Nulls: 0 Density: 6.6667e-07 Min: 163 Max: 5998114<br />
Index Stats::<br />
  Index: PK_ORDERS  Col#: 1<br />
    LVLS: 2  #LB: 3307  #DK: 1500000  LB/K: 1.00  DB/K: 1.00  CLUF: 24045.00</p>
<p>Join order[2]:  LINEITEM[LINEITEM]#1  ORDERS[ORDERS]#0<br />
***************<br />
Now joining: ORDERS[ORDERS]#0<br />
***************<br />
NL Join<br />
  Outer table: Card: 6001215.00  Cost: 2994.16  Resp: 2994.16  Degree: 1  Bytes: 6<br />
  Inner table: ORDERS  Alias: ORDERS<br />
  Access Path: TableScan<br />
    NL Join:  Cost: 27976374778.51  Resp: 27976374778.51  Degree: 0<br />
      Cost_io: 27873478291.00  Cost_cpu: 2386397111117456<br />
      Resp_io: 27873478291.00  Resp_cpu: 2386397111117456<br />
  Access Path: index (index (FFS))<br />
    Index: PK_ORDERS<br />
    resc_io: 633.55  resc_cpu: 203550602<br />
    ix_sel: 0.0000e+00  ix_sel_with_filters: 1<br />
  Inner table: ORDERS  Alias: ORDERS<br />
  Access Path: index (FFS)<br />
    NL Join:  Cost: 3854751895.27  Resp: 3854751895.27  Degree: 0<br />
      Cost_io: 3802081121.00  Cost_cpu: 1221551742006481<br />
      Resp_io: 3802081121.00  Resp_cpu: 1221551742006481<br />
  Access Path: index (UniqueScan)<br />
    Index: PK_ORDERS<br />
    resc_io: 1.00  resc_cpu: 15293<br />
    ix_sel: 6.6667e-07  ix_sel_with_filters: 6.6667e-07<br />
    NL Join (ordered): Cost: 10714.35  Resp: 10714.35  Degree: 1<br />
      Cost_io: 6722.00  Cost_cpu: 92591405803<br />
      Resp_io: 6722.00  Resp_cpu: 92591405803<br />
  Access Path: index (AllEqUnique)<br />
    Index: PK_ORDERS<br />
    resc_io: 1.00  resc_cpu: 15293<br />
    ix_sel: 6.6667e-07  ix_sel_with_filters: 6.6667e-07<br />
    NL Join (ordered): Cost: 10714.35  Resp: 10714.35  Degree: 1<br />
      Cost_io: 6722.00  Cost_cpu: 92591405803<br />
      Resp_io: 6722.00  Resp_cpu: 92591405803<br />
  Best NL cost: 10714.35<br />
          resc: 10714.35 resc_io: 6722.00 resc_cpu: 92591405803<br />
          resp: 10714.35 resp_io: 6722.00 resp_cpu: 92591405803</p>
<p>Kindly expalin how the cost has been calculated. This does not follow the traditional nested loop cost formula as mentioned in the book.</p>
<p>Thanks<br />
Regards,</p>
<p>Rekha Singhal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: damirvadasDamir Vadas</title>
		<link>http://jonathanlewis.wordpress.com/comments-on-comment/#comment-40983</link>
		<dc:creator><![CDATA[damirvadasDamir Vadas]]></dc:creator>
		<pubDate>Tue, 12 Jul 2011 20:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?page_id=2612#comment-40983</guid>
		<description><![CDATA[Hi!

Did you saw:
http://www.dba-village.com/village/dvp_links.LinkDetail?LinkIdA=10707
which lead to:
http://jonathanlewis.wordpress.com/2011/06/23/video/

Is that approved according your knowledge?
:-)

Rg,
Damir Vadas
http://damir-vadas.blogspot.com]]></description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Did you saw:<br />
<a href="http://www.dba-village.com/village/dvp_links.LinkDetail?LinkIdA=10707" rel="nofollow">http://www.dba-village.com/village/dvp_links.LinkDetail?LinkIdA=10707</a><br />
which lead to:<br />
<a href="http://jonathanlewis.wordpress.com/2011/06/23/video/" rel="nofollow">http://jonathanlewis.wordpress.com/2011/06/23/video/</a></p>
<p>Is that approved according your knowledge?<br />
:-)</p>
<p>Rg,<br />
Damir Vadas<br />
<a href="http://damir-vadas.blogspot.com" rel="nofollow">http://damir-vadas.blogspot.com</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
