<?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: NewDensity</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2012/01/03/newdensity/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 24 May 2013 13:27:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: PerfNewbie</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-52126</link>
		<dc:creator><![CDATA[PerfNewbie]]></dc:creator>
		<pubDate>Fri, 14 Dec 2012 21:53:24 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-52126</guid>
		<description><![CDATA[Oops! Sorry (embarrassed). I got hung up with doing math to derive cardinality...I should have simply checked for default. I realized only when driving back home (just need some diversion I guess). 

Thanks for your reply.]]></description>
		<content:encoded><![CDATA[<p>Oops! Sorry (embarrassed). I got hung up with doing math to derive cardinality&#8230;I should have simply checked for default. I realized only when driving back home (just need some diversion I guess). </p>
<p>Thanks for your reply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-52108</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 14 Dec 2012 06:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-52108</guid>
		<description><![CDATA[It&#039;s always worth spending a couple of minutes working backwards just in case it gives you a clue:

Oracle&#039;s cardinality = 15458
Oracle&#039;s number of rows input = 309157
So Oracle&#039;s selectivity = 15458 / 309157 = 0.05000049

Oracle has used the standard 5% for &quot;column &gt; unknown value&quot; in this case.]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s always worth spending a couple of minutes working backwards just in case it gives you a clue:</p>
<p>Oracle&#8217;s cardinality = 15458<br />
Oracle&#8217;s number of rows input = 309157<br />
So Oracle&#8217;s selectivity = 15458 / 309157 = 0.05000049</p>
<p>Oracle has used the standard 5% for &#8220;column &gt; unknown value&#8221; in this case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PerfNewbie</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-52105</link>
		<dc:creator><![CDATA[PerfNewbie]]></dc:creator>
		<pubDate>Fri, 14 Dec 2012 00:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-52105</guid>
		<description><![CDATA[First time I&#039;m able to compute New Density. Thanks for a simple and detailed explanation.

However, cardinality estimate is off. My column is not null column with FBI on it (upper(column)) and no popular values. 

Predicate is &quot;col like :bindvar&#124;&#124;&#039;%&#039;&quot;. Bind value is within range. 
[sourcecode]
    NewDensity:0.000015, OldDensity:0.000239 BktCnt:254, PopBktCnt:0, PopValCnt:0, NDV:67072
  Column (#41): SYS_NC00041$(
    AvgLen: 50 NDV: 67072 Nulls: 0 Density: 0.000015
    Histogram: HtBal  #Bkts: 254  UncompBkts: 254  EndPtVals: 255
    Card: Original: 309157.000000  Rounded: 15458  Computed: 15457.85  Non Adjusted: 15457.85
[/sourcecode]
Cardinality = 0.000015 * 309157 = 4.637355 vs 15458 (computed by CBO)

Not sure what type of math I should do for a unbounded range...

Will try to figure out by going through your book. But, do you by any chance think this is a bug?

Appreciate your contribution to Oracle community,
Thanks!]]></description>
		<content:encoded><![CDATA[<p>First time I&#8217;m able to compute New Density. Thanks for a simple and detailed explanation.</p>
<p>However, cardinality estimate is off. My column is not null column with FBI on it (upper(column)) and no popular values. </p>
<p>Predicate is &#8220;col like :bindvar||&#8217;%'&#8221;. Bind value is within range. </p>
<pre class="brush: plain; title: ; notranslate">
    NewDensity:0.000015, OldDensity:0.000239 BktCnt:254, PopBktCnt:0, PopValCnt:0, NDV:67072
  Column (#41): SYS_NC00041$(
    AvgLen: 50 NDV: 67072 Nulls: 0 Density: 0.000015
    Histogram: HtBal  #Bkts: 254  UncompBkts: 254  EndPtVals: 255
    Card: Original: 309157.000000  Rounded: 15458  Computed: 15457.85  Non Adjusted: 15457.85
</pre>
<p>Cardinality = 0.000015 * 309157 = 4.637355 vs 15458 (computed by CBO)</p>
<p>Not sure what type of math I should do for a unbounded range&#8230;</p>
<p>Will try to figure out by going through your book. But, do you by any chance think this is a bug?</p>
<p>Appreciate your contribution to Oracle community,<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: suresh</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-48124</link>
		<dc:creator><![CDATA[suresh]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 15:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-48124</guid>
		<description><![CDATA[Hi Jonathan,

Thanks for your time and Thanks for the comments too.

There&#039;s lot of predicates on the given table and not particularly using any index and doing a full table scan. To add more, the query in the question is having problem only on monday after a table re-org (ofcourse stats has been gathered after rebuild) and rest of the days its back to normal. No change in plans and nothing, hence trying to cornering how the cost has been derived. Will further dig more.

I must say, I have been learning a lot with your blog and your nice book &quot;CBO - fundamentals&quot;, Thank you...

Regards
Suresh]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Thanks for your time and Thanks for the comments too.</p>
<p>There&#8217;s lot of predicates on the given table and not particularly using any index and doing a full table scan. To add more, the query in the question is having problem only on monday after a table re-org (ofcourse stats has been gathered after rebuild) and rest of the days its back to normal. No change in plans and nothing, hence trying to cornering how the cost has been derived. Will further dig more.</p>
<p>I must say, I have been learning a lot with your blog and your nice book &#8220;CBO &#8211; fundamentals&#8221;, Thank you&#8230;</p>
<p>Regards<br />
Suresh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-48116</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 10:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-48116</guid>
		<description><![CDATA[Suresh,

It can take some time to work these things out, and it&#039;s not a particularly interesting or educational task; so I only do it when I&#039;m being paid to do it or puzzled by an example that&#039;s appeared in a forum.

In your example there are two things that would make it harder to do: (a) every column has a histogram - so you might have to look at the histogram data in great detail, and (b) you haven&#039;t told me what the predicates are that the optimizer will be evaluating at this point - and not that they may NOT be exactly the predicates you wrote in your initial query.]]></description>
		<content:encoded><![CDATA[<p>Suresh,</p>
<p>It can take some time to work these things out, and it&#8217;s not a particularly interesting or educational task; so I only do it when I&#8217;m being paid to do it or puzzled by an example that&#8217;s appeared in a forum.</p>
<p>In your example there are two things that would make it harder to do: (a) every column has a histogram &#8211; so you might have to look at the histogram data in great detail, and (b) you haven&#8217;t told me what the predicates are that the optimizer will be evaluating at this point &#8211; and not that they may NOT be exactly the predicates you wrote in your initial query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: suresh</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-48034</link>
		<dc:creator><![CDATA[suresh]]></dc:creator>
		<pubDate>Tue, 17 Jul 2012 06:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-48034</guid>
		<description><![CDATA[Hello Jonathan,

Would you able to help me in understanding the cardinality from the following output, how was 1642 derived?
[sourcecode]
SINGLE TABLE ACCESS PATH
  Single Table Cardinality Estimation for TRADE[T]
  Column (#2):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:4, NDV:4
  Column (#105):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:2, NDV:2
  Column (#55):
    NewDensity:0.000002, OldDensity:0.000002 BktCnt:2835, PopBktCnt:2835, PopValCnt:2, NDV:2
  Column (#1):
    NewDensity:0.000002, OldDensity:0.000002 BktCnt:254, PopBktCnt:0, PopValCnt:0, NDV:443488
  Column (#72):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:2, NDV:4
  Column (#6):
    NewDensity:0.001419, OldDensity:0.002012 BktCnt:254, PopBktCnt:10, PopValCnt:5, NDV:682
  Column (#159):
    NewDensity:0.000003, OldDensity:0.000038 BktCnt:254, PopBktCnt:2, PopValCnt:1, NDV:310528
  Column (#16):
    NewDensity:0.000002, OldDensity:0.000005 BktCnt:254, PopBktCnt:10, PopValCnt:1, NDV:426496
  Column (#157):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:3, NDV:4
  Column (#155):
    NewDensity:0.000215, OldDensity:0.001799 BktCnt:254, PopBktCnt:81, PopValCnt:13, NDV:3175
  Column (#4):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5178, PopBktCnt:5178, PopValCnt:6, NDV:7
  ColGroup (#1, Index) IDX_TRD_DVP_FEX
    Col#: 1 2 5 8 53 60 73 105 108    CorStregth: -1.00
  ColGroup (#2, Index) IDXTRDTAX
    Col#: 1 2 55 68 72 105 135    CorStregth: 52038.16
  ColGroup (#8, Index) IDX_TRADE_FX
    Col#: 1 2 5 8 105 108    CorStregth: -1.00
  ColGroup (#5, Index) IDX$$_4B290002
    Col#: 2 6 154 155 156    CorStregth: 2298053781278.98
  ColGroup (#7, Index) FEXIGNOREEXCEPTION_712A0001
    Col#: 2 5 8 105 108    CorStregth: -1.00
  ColGroup (#6, Index) IDX_TRADE_COMM
    Col#: 2 4 5 153    CorStregth: -1.00
  ColGroup (#9, Index) IDX$$_50990001
    Col#: 6 7 12    CorStregth: -1.00
  ColGroup (#10, Index) TRADE_UK1
    Col#: 1 6 46    CorStregth: -1.00
  ColGroup (#3, Index) IDX$$_173D0004
    Col#: 6 159    CorStregth: 575.99
  ColGroup (#4, Index) IDX$$_4B2C0004
    Col#: 16 157    CorStregth: 4.00
  ColGroup Usage:: PredCnt: 4  Matches Full:  Partial:
  Table: TRADE  Alias: T
    Card: Original: 471074.000000  Rounded: 1642  Computed: 1641.93  Non Adjusted: 1641.93
  Access Path: TableScan
    Cost:  12436.31  Resp: 12436.31  Degree: 0
      Cost_io: 12338.00  Cost_cpu: 2113927982
      Resp_io: 12338.00  Resp_cpu: 2113927982
[/sourcecode]
]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>Would you able to help me in understanding the cardinality from the following output, how was 1642 derived?</p>
<pre class="brush: plain; title: ; notranslate">
SINGLE TABLE ACCESS PATH
  Single Table Cardinality Estimation for TRADE[T]
  Column (#2):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:4, NDV:4
  Column (#105):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:2, NDV:2
  Column (#55):
    NewDensity:0.000002, OldDensity:0.000002 BktCnt:2835, PopBktCnt:2835, PopValCnt:2, NDV:2
  Column (#1):
    NewDensity:0.000002, OldDensity:0.000002 BktCnt:254, PopBktCnt:0, PopValCnt:0, NDV:443488
  Column (#72):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:2, NDV:4
  Column (#6):
    NewDensity:0.001419, OldDensity:0.002012 BktCnt:254, PopBktCnt:10, PopValCnt:5, NDV:682
  Column (#159):
    NewDensity:0.000003, OldDensity:0.000038 BktCnt:254, PopBktCnt:2, PopValCnt:1, NDV:310528
  Column (#16):
    NewDensity:0.000002, OldDensity:0.000005 BktCnt:254, PopBktCnt:10, PopValCnt:1, NDV:426496
  Column (#157):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5402, PopBktCnt:5402, PopValCnt:3, NDV:4
  Column (#155):
    NewDensity:0.000215, OldDensity:0.001799 BktCnt:254, PopBktCnt:81, PopValCnt:13, NDV:3175
  Column (#4):
    NewDensity:0.000001, OldDensity:0.000001 BktCnt:5178, PopBktCnt:5178, PopValCnt:6, NDV:7
  ColGroup (#1, Index) IDX_TRD_DVP_FEX
    Col#: 1 2 5 8 53 60 73 105 108    CorStregth: -1.00
  ColGroup (#2, Index) IDXTRDTAX
    Col#: 1 2 55 68 72 105 135    CorStregth: 52038.16
  ColGroup (#8, Index) IDX_TRADE_FX
    Col#: 1 2 5 8 105 108    CorStregth: -1.00
  ColGroup (#5, Index) IDX$$_4B290002
    Col#: 2 6 154 155 156    CorStregth: 2298053781278.98
  ColGroup (#7, Index) FEXIGNOREEXCEPTION_712A0001
    Col#: 2 5 8 105 108    CorStregth: -1.00
  ColGroup (#6, Index) IDX_TRADE_COMM
    Col#: 2 4 5 153    CorStregth: -1.00
  ColGroup (#9, Index) IDX$$_50990001
    Col#: 6 7 12    CorStregth: -1.00
  ColGroup (#10, Index) TRADE_UK1
    Col#: 1 6 46    CorStregth: -1.00
  ColGroup (#3, Index) IDX$$_173D0004
    Col#: 6 159    CorStregth: 575.99
  ColGroup (#4, Index) IDX$$_4B2C0004
    Col#: 16 157    CorStregth: 4.00
  ColGroup Usage:: PredCnt: 4  Matches Full:  Partial:
  Table: TRADE  Alias: T
    Card: Original: 471074.000000  Rounded: 1642  Computed: 1641.93  Non Adjusted: 1641.93
  Access Path: TableScan
    Cost:  12436.31  Resp: 12436.31  Degree: 0
      Cost_io: 12338.00  Cost_cpu: 2113927982
      Resp_io: 12338.00  Resp_cpu: 2113927982
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajeet</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-45442</link>
		<dc:creator><![CDATA[Ajeet]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 11:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-45442</guid>
		<description><![CDATA[Hello Jonathan,

Thanks so much for explaining .I do have your book - cost based oracle -fundamentals, but I could not find the discussion on cost of unique index access ,but I do see some sort of discussion on it in chapter 11 . (nested loops).
Yes the blevel of the unique index which is a PK is 1 . you are absolutely correct . 

Kindly point out where in the cost based oracle -fundamentals, I could see more details on this.
I have a hard copy and I might have skipped that section inadvertantely. 

Regards.
Ajeet]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>Thanks so much for explaining .I do have your book &#8211; cost based oracle -fundamentals, but I could not find the discussion on cost of unique index access ,but I do see some sort of discussion on it in chapter 11 . (nested loops).<br />
Yes the blevel of the unique index which is a PK is 1 . you are absolutely correct . </p>
<p>Kindly point out where in the cost based oracle -fundamentals, I could see more details on this.<br />
I have a hard copy and I might have skipped that section inadvertantely. </p>
<p>Regards.<br />
Ajeet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-45438</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 10:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-45438</guid>
		<description><![CDATA[Ajeet,

I think this is an example covered in my book &lt;a href=&quot;http://www.amazon.com/Cost-Based-Oracle-Fundamentals-Experts-Voice/dp/1590596366&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;&quot;Cost Based Oracle - Fundamentals&quot;&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;, but I can&#039;t be completely certain since I don&#039;t have all the information about your tables and indexes in front of me. The basic points, however, are this:
&lt;blockquote&gt;
a) the orders_pk index looks like it might be the index on a primary key column
b) for index-only access on unique indexes the optimizer subtracts 1 from the normal index-only cost
c) for index access by nested loop the optimizeir subtracts 1 from the expected cost
&lt;/blockquote&gt;
I suspect from this that your index has a blevel of 1: so the cost of &quot;select o_orderkey from orders where o_orderkey = {constant}&quot; has a cost of 1, and the cost of accessing just the order key in the nested loop is zero.]]></description>
		<content:encoded><![CDATA[<p>Ajeet,</p>
<p>I think this is an example covered in my book <a href="http://www.amazon.com/Cost-Based-Oracle-Fundamentals-Experts-Voice/dp/1590596366" rel="nofollow"><em><strong>&#8220;Cost Based Oracle &#8211; Fundamentals&#8221;</strong></em></a>, but I can&#8217;t be completely certain since I don&#8217;t have all the information about your tables and indexes in front of me. The basic points, however, are this:</p>
<blockquote><p>
a) the orders_pk index looks like it might be the index on a primary key column<br />
b) for index-only access on unique indexes the optimizer subtracts 1 from the normal index-only cost<br />
c) for index access by nested loop the optimizeir subtracts 1 from the expected cost
</p></blockquote>
<p>I suspect from this that your index has a blevel of 1: so the cost of &#8220;select o_orderkey from orders where o_orderkey = {constant}&#8221; has a cost of 1, and the cost of accessing just the order key in the nested loop is zero.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajeet</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-45373</link>
		<dc:creator><![CDATA[Ajeet]]></dc:creator>
		<pubDate>Fri, 09 Mar 2012 12:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-45373</guid>
		<description><![CDATA[Hello Jonathan,

What could be the possible reason of  COST = 0  for unique index scan operation of the following query and plan. I am not able to understand the reason.
Could you please help.
[sourcecode]
sql_id=52a0skswvaqvk.
Current SQL statement for this session:
explain plan for select
count(*)
from
	orders,
        lineitem
where
	o_orderkey = l_orderkey
 
============
Plan Table
============
---------------------------------------------+-----------------------------------+
&#124; Id  &#124; Operation               &#124; Name       &#124; Rows  &#124; Bytes &#124; Cost  &#124; Time      &#124;
---------------------------------------------+-----------------------------------+
&#124; 0   &#124; SELECT STATEMENT        &#124;            &#124;       &#124;       &#124;   343 &#124;           &#124;
&#124; 1   &#124;  SORT AGGREGATE         &#124;            &#124;     1 &#124;    10 &#124;       &#124;           &#124;
&#124; 2   &#124;   NESTED LOOPS          &#124;            &#124;  583K &#124; 5830K &#124;   343 &#124;  00:00:05 &#124;
&#124; 3   &#124;    INDEX FAST FULL SCAN &#124; PK_LINEITEM&#124;  586K &#124; 2932K &#124;   294 &#124;  00:00:05 &#124;
&#124; 4   &#124;    INDEX UNIQUE SCAN    &#124; PK_ORDERS  &#124;     1 &#124;     5 &#124;     0 &#124;           &#124;
---------------------------------------------+-----------------------------------+
Predicate Information:
----------------------
4 - access(&quot;O_ORDERKEY&quot;=&quot;L_ORDERKEY&quot;)
 
Content of other_xml column
===========================
  db_version     : 10.2.0.1
  parse_schema   : EMUDSS
  plan_hash      : 2594599139
  Outline Data:
  /*+
    BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE(&#039;10.2.0.1&#039;)
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$1&quot;)
      INDEX_FFS(@&quot;SEL$1&quot; &quot;LINEITEM&quot;@&quot;SEL$1&quot;(&quot;LINEITEM&quot;.&quot;L_ORDERKEY&quot; &quot;LINEITEM&quot;.&quot;L_LINENUMBER&quot;))
      INDEX(@&quot;SEL$1&quot; &quot;ORDERS&quot;@&quot;SEL$1&quot; (&quot;ORDERS&quot;.&quot;O_ORDERKEY&quot;))
      LEADING(@&quot;SEL$1&quot; &quot;LINEITEM&quot;@&quot;SEL$1&quot; &quot;ORDERS&quot;@&quot;SEL$1&quot;)
      USE_NL(@&quot;SEL$1&quot; &quot;ORDERS&quot;@&quot;SEL$1&quot;)
    END_OUTLINE_DATA
  */

[/sourcecode]
]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>What could be the possible reason of  COST = 0  for unique index scan operation of the following query and plan. I am not able to understand the reason.<br />
Could you please help.</p>
<pre class="brush: plain; title: ; notranslate">
sql_id=52a0skswvaqvk.
Current SQL statement for this session:
explain plan for select
count(*)
from
	orders,
        lineitem
where
	o_orderkey = l_orderkey
 
============
Plan Table
============
---------------------------------------------+-----------------------------------+
| Id  | Operation               | Name       | Rows  | Bytes | Cost  | Time      |
---------------------------------------------+-----------------------------------+
| 0   | SELECT STATEMENT        |            |       |       |   343 |           |
| 1   |  SORT AGGREGATE         |            |     1 |    10 |       |           |
| 2   |   NESTED LOOPS          |            |  583K | 5830K |   343 |  00:00:05 |
| 3   |    INDEX FAST FULL SCAN | PK_LINEITEM|  586K | 2932K |   294 |  00:00:05 |
| 4   |    INDEX UNIQUE SCAN    | PK_ORDERS  |     1 |     5 |     0 |           |
---------------------------------------------+-----------------------------------+
Predicate Information:
----------------------
4 - access(&quot;O_ORDERKEY&quot;=&quot;L_ORDERKEY&quot;)
 
Content of other_xml column
===========================
  db_version     : 10.2.0.1
  parse_schema   : EMUDSS
  plan_hash      : 2594599139
  Outline Data:
  /*+
    BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('10.2.0.1')
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$1&quot;)
      INDEX_FFS(@&quot;SEL$1&quot; &quot;LINEITEM&quot;@&quot;SEL$1&quot;(&quot;LINEITEM&quot;.&quot;L_ORDERKEY&quot; &quot;LINEITEM&quot;.&quot;L_LINENUMBER&quot;))
      INDEX(@&quot;SEL$1&quot; &quot;ORDERS&quot;@&quot;SEL$1&quot; (&quot;ORDERS&quot;.&quot;O_ORDERKEY&quot;))
      LEADING(@&quot;SEL$1&quot; &quot;LINEITEM&quot;@&quot;SEL$1&quot; &quot;ORDERS&quot;@&quot;SEL$1&quot;)
      USE_NL(@&quot;SEL$1&quot; &quot;ORDERS&quot;@&quot;SEL$1&quot;)
    END_OUTLINE_DATA
  */

</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: oracleman consulting</title>
		<link>http://jonathanlewis.wordpress.com/2012/01/03/newdensity/#comment-43988</link>
		<dc:creator><![CDATA[oracleman consulting]]></dc:creator>
		<pubDate>Tue, 03 Jan 2012 18:17:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8061#comment-43988</guid>
		<description><![CDATA[wow - thanks for the detailed info]]></description>
		<content:encoded><![CDATA[<p>wow &#8211; thanks for the detailed info</p>
]]></content:encoded>
	</item>
</channel>
</rss>
