<?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: Plan Cardinality Estimates Problem with 11.1.0.7 and 11.2.0.1</title>
	<atom:link href="http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Thu, 23 May 2013 04:02:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/#comment-524</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Thu, 18 Mar 2010 14:31:24 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1372#comment-524</guid>
		<description><![CDATA[Coskan,

Thanks for filling in the missing details, Narendra&#039;s comment makes a little more sense with the links that you provided.

Incidentally, if you do not want to delete from the data dictionary as Hemant did (with appropriate cautions mentioned), you can see whether or not SYS.COL_USAGE$ is used during a statistics collection with an approach like this (using one of the tables created for the March 18, 2010 blog article)&quot;

&lt;pre&gt;
EXEC DBMS_STATS.DELETE_TABLE_STATS(OWNNAME=&gt;USER,TABNAME=&gt;&#039;USER_PROGRAM_PERMISSION&#039;)
 
ALTER SESSION SET TRACEFILE_IDENTIFIER = &#039;STATISTICS&#039;;
ALTER SESSION SET EVENTS &#039;10046 TRACE NAME CONTEXT FOREVER, LEVEL 1&#039;;
 
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=&gt;USER,TABNAME=&gt;&#039;USER_PROGRAM_PERMISSION&#039;,CASCADE=&gt;TRUE,METHOD_OPT=&gt;&#039;FOR ALL COLUMNS SIZE AUTO&#039;)
 
ALTER SESSION SET EVENTS &#039;10046 TRACE NAME CONTEXT OFF&#039;;
&lt;/pre&gt;

If you pass the resulting trace file through a program, such as TKPROF, you will see a variety of SQL statements with the dep= set to 1 or greater.  One of those SQL statements looks something like this:

&lt;pre&gt;
SELECT /*+ ordered use_nl(o c cu h) index(u i_user1) index(o i_obj2) 
               index(ci_obj#) index(cu i_col_usage$) 
               index(h i_hh_obj#_intcol#) */
  C.NAME COL_NAME, C.TYPE# COL_TYPE, C.CHARSETFORM COL_CSF,
  C.DEFAULT$ COL_DEF, C.NULL$ COL_NULL, C.PROPERTY COL_PROP,
  C.COL# COL_UNUM, C.INTCOL# COL_INUM, C.OBJ# COL_OBJ, C.SCALE COL_SCALE,
  H.BUCKET_CNT H_BCNT, (T.ROWCNT-H.NULL_CNT)/GREATEST(H.DISTCNT,1) H_PFREQ,
  C.LENGTH COL_LEN, CU.TIMESTAMP CU_TIME, CU.EQUALITY_PREDS CU_EP,
  CU.EQUIJOIN_PREDS CU_EJP, CU.RANGE_PREDS CU_RP, CU.LIKE_PREDS CU_LP,
  CU.NONEQUIJOIN_PREDS CU_NEJP, CU.NULL_PREDS NP
FROM
  SYS.USER$ U, SYS.OBJ$ O, SYS.TAB$ T, SYS.COL$ C,
  SYS.COL_USAGE$ CU, SYS.HIST_HEAD$ H 
WHERE
  :B3 = &#039;0&#039; AND U.NAME = :B2 AND O.OWNER# = U.USER# AND O.TYPE# = 2
  AND O.NAME = :B1 AND O.OBJ# = T.OBJ# AND O.OBJ# = C.OBJ#
  AND C.OBJ# = CU.OBJ#(+) AND C.INTCOL# = CU.INTCOL#(+) AND
  C.OBJ# = H.OBJ#(+) AND C.INTCOL# = H.INTCOL#(+)
UNION ALL 
SELECT /*+ ordered use_nl(c) */
  C.KQFCONAM COL_NAME, C.KQFCODTY COL_TYPE, DECODE(C.KQFCODTY, 1, 1, 0) COL_CSF,
  NULL COL_DEF, 0 COL_NULL, 0 COL_PROP, C.KQFCOCNO COL_UNUM, C.KQFCOCNO COL_INUM,
  O.KQFTAOBJ COL_OBJ, DECODE(C.KQFCODTY, 2, -127, 0) COL_SCALE,
  H.BUCKET_CNT H_BCNT, (ST.ROWCNT-NULL_CNT)/GREATEST(H.DISTCNT,1) H_PFREQ,
  DECODE(C.KQFCODTY, 2, 22, C.KQFCOSIZ) COL_LEN, CU.TIMESTAMP CU_TIME,
  CU.EQUALITY_PREDS CU_EP, CU.EQUIJOIN_PREDS CU_EJP, CU.RANGE_PREDS CU_RP,
  CU.LIKE_PREDS CU_LP, CU.NONEQUIJOIN_PREDS CU_NEJP, CU.NULL_PREDS NP
FROM
  SYS.X$KQFTA O, SYS.TAB_STATS$ ST, SYS.X$KQFCO C,
  SYS.COL_USAGE$ CU, SYS.HIST_HEAD$ H
WHERE
  :B3 != &#039;0&#039; AND :B2 = &#039;SYS&#039; AND O.KQFTANAM = :B1 AND O.KQFTAOBJ = ST.OBJ#(+)
  AND O.KQFTAOBJ = C.KQFCOTOB AND C.KQFCOTOB = CU.OBJ#(+)
  AND C.KQFCOCNO = CU.INTCOL#(+) AND C.KQFCOTOB = H.OBJ#(+)
  AND C.KQFCOCNO = H.INTCOL#(+);
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Coskan,</p>
<p>Thanks for filling in the missing details, Narendra&#8217;s comment makes a little more sense with the links that you provided.</p>
<p>Incidentally, if you do not want to delete from the data dictionary as Hemant did (with appropriate cautions mentioned), you can see whether or not SYS.COL_USAGE$ is used during a statistics collection with an approach like this (using one of the tables created for the March 18, 2010 blog article)&#8221;</p>
<pre>
EXEC DBMS_STATS.DELETE_TABLE_STATS(OWNNAME=&gt;USER,TABNAME=&gt;'USER_PROGRAM_PERMISSION')
 
ALTER SESSION SET TRACEFILE_IDENTIFIER = 'STATISTICS';
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 1';
 
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=&gt;USER,TABNAME=&gt;'USER_PROGRAM_PERMISSION',CASCADE=&gt;TRUE,METHOD_OPT=&gt;'FOR ALL COLUMNS SIZE AUTO')
 
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF';
</pre>
<p>If you pass the resulting trace file through a program, such as TKPROF, you will see a variety of SQL statements with the dep= set to 1 or greater.  One of those SQL statements looks something like this:</p>
<pre>
SELECT /*+ ordered use_nl(o c cu h) index(u i_user1) index(o i_obj2) 
               index(ci_obj#) index(cu i_col_usage$) 
               index(h i_hh_obj#_intcol#) */
  C.NAME COL_NAME, C.TYPE# COL_TYPE, C.CHARSETFORM COL_CSF,
  C.DEFAULT$ COL_DEF, C.NULL$ COL_NULL, C.PROPERTY COL_PROP,
  C.COL# COL_UNUM, C.INTCOL# COL_INUM, C.OBJ# COL_OBJ, C.SCALE COL_SCALE,
  H.BUCKET_CNT H_BCNT, (T.ROWCNT-H.NULL_CNT)/GREATEST(H.DISTCNT,1) H_PFREQ,
  C.LENGTH COL_LEN, CU.TIMESTAMP CU_TIME, CU.EQUALITY_PREDS CU_EP,
  CU.EQUIJOIN_PREDS CU_EJP, CU.RANGE_PREDS CU_RP, CU.LIKE_PREDS CU_LP,
  CU.NONEQUIJOIN_PREDS CU_NEJP, CU.NULL_PREDS NP
FROM
  SYS.USER$ U, SYS.OBJ$ O, SYS.TAB$ T, SYS.COL$ C,
  SYS.COL_USAGE$ CU, SYS.HIST_HEAD$ H 
WHERE
  :B3 = '0' AND U.NAME = :B2 AND O.OWNER# = U.USER# AND O.TYPE# = 2
  AND O.NAME = :B1 AND O.OBJ# = T.OBJ# AND O.OBJ# = C.OBJ#
  AND C.OBJ# = CU.OBJ#(+) AND C.INTCOL# = CU.INTCOL#(+) AND
  C.OBJ# = H.OBJ#(+) AND C.INTCOL# = H.INTCOL#(+)
UNION ALL 
SELECT /*+ ordered use_nl(c) */
  C.KQFCONAM COL_NAME, C.KQFCODTY COL_TYPE, DECODE(C.KQFCODTY, 1, 1, 0) COL_CSF,
  NULL COL_DEF, 0 COL_NULL, 0 COL_PROP, C.KQFCOCNO COL_UNUM, C.KQFCOCNO COL_INUM,
  O.KQFTAOBJ COL_OBJ, DECODE(C.KQFCODTY, 2, -127, 0) COL_SCALE,
  H.BUCKET_CNT H_BCNT, (ST.ROWCNT-NULL_CNT)/GREATEST(H.DISTCNT,1) H_PFREQ,
  DECODE(C.KQFCODTY, 2, 22, C.KQFCOSIZ) COL_LEN, CU.TIMESTAMP CU_TIME,
  CU.EQUALITY_PREDS CU_EP, CU.EQUIJOIN_PREDS CU_EJP, CU.RANGE_PREDS CU_RP,
  CU.LIKE_PREDS CU_LP, CU.NONEQUIJOIN_PREDS CU_NEJP, CU.NULL_PREDS NP
FROM
  SYS.X$KQFTA O, SYS.TAB_STATS$ ST, SYS.X$KQFCO C,
  SYS.COL_USAGE$ CU, SYS.HIST_HEAD$ H
WHERE
  :B3 != '0' AND :B2 = 'SYS' AND O.KQFTANAM = :B1 AND O.KQFTAOBJ = ST.OBJ#(+)
  AND O.KQFTAOBJ = C.KQFCOTOB AND C.KQFCOTOB = CU.OBJ#(+)
  AND C.KQFCOCNO = CU.INTCOL#(+) AND C.KQFCOTOB = H.OBJ#(+)
  AND C.KQFCOCNO = H.INTCOL#(+);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: coskan</title>
		<link>http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/#comment-521</link>
		<dc:creator><![CDATA[coskan]]></dc:creator>
		<pubDate>Wed, 17 Mar 2010 19:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1372#comment-521</guid>
		<description><![CDATA[I think Narenda tried to explain the issue Hemant covered here 

http://hemantoracledba.blogspot.com/2008/08/more-tests-of-colusage.html

Basically when &quot;for all columns size auto&quot; used data distribution and  the workload of the columns (column usage) are considered.mentioned in &lt;a href=&quot;http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1036461&quot; rel=&quot;nofollow&quot;&gt;doc&lt;/a&gt; .]]></description>
		<content:encoded><![CDATA[<p>I think Narenda tried to explain the issue Hemant covered here </p>
<p><a href="http://hemantoracledba.blogspot.com/2008/08/more-tests-of-colusage.html" rel="nofollow">http://hemantoracledba.blogspot.com/2008/08/more-tests-of-colusage.html</a></p>
<p>Basically when &#8220;for all columns size auto&#8221; used data distribution and  the workload of the columns (column usage) are considered.mentioned in <a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1036461" rel="nofollow">doc</a> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narendra</title>
		<link>http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/#comment-378</link>
		<dc:creator><![CDATA[Narendra]]></dc:creator>
		<pubDate>Tue, 16 Feb 2010 09:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1372#comment-378</guid>
		<description><![CDATA[Charles,

Apologies. My followup point was completely misguided.]]></description>
		<content:encoded><![CDATA[<p>Charles,</p>
<p>Apologies. My followup point was completely misguided.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/#comment-373</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Mon, 15 Feb 2010 14:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1372#comment-373</guid>
		<description><![CDATA[Narendra,

I am not sure that I understand your question.  Please see the follow-up to the blog article (at the end of the blog article) to see if your question is answered in that section.]]></description>
		<content:encoded><![CDATA[<p>Narendra,</p>
<p>I am not sure that I understand your question.  Please see the follow-up to the blog article (at the end of the blog article) to see if your question is answered in that section.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narendra</title>
		<link>http://hoopercharles.wordpress.com/2010/02/15/plan-cardinality-estimates-problem-with-11-1-0-7-and-11-2-0-1/#comment-371</link>
		<dc:creator><![CDATA[Narendra]]></dc:creator>
		<pubDate>Mon, 15 Feb 2010 09:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1372#comment-371</guid>
		<description><![CDATA[&lt;i&gt;What are your thoughts?  Is the METHOD_OPT parameter of DBMS_STATS.GATHER_TABLE_STATS only used to specify how histograms will be collected for columns, or does that parameter also specify for which columns column-level statistics should be gathered?&lt;/i&gt;

Is the &quot;intelligence&quot; in statistics collection, that checks SYS.COL_USAGE$, the reason ?]]></description>
		<content:encoded><![CDATA[<p><i>What are your thoughts?  Is the METHOD_OPT parameter of DBMS_STATS.GATHER_TABLE_STATS only used to specify how histograms will be collected for columns, or does that parameter also specify for which columns column-level statistics should be gathered?</i></p>
<p>Is the &#8220;intelligence&#8221; in statistics collection, that checks SYS.COL_USAGE$, the reason ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
