<?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: Cardinality feedback</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/</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: Vivek Sharma</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-37295</link>
		<dc:creator><![CDATA[Vivek Sharma]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 16:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-37295</guid>
		<description><![CDATA[On the comment on EGOR above, 11g provides &quot;Cardinality Feedback used for this statement&quot; and changes the plan dynamically. I have noticed this at one of my customer site and plan to write on this. The plan changed for good, in my case, after few executions. This can be controlled by _optimizer_use_feedback.

Regards
Vivek]]></description>
		<content:encoded><![CDATA[<p>On the comment on EGOR above, 11g provides &#8220;Cardinality Feedback used for this statement&#8221; and changes the plan dynamically. I have noticed this at one of my customer site and plan to write on this. The plan changed for good, in my case, after few executions. This can be controlled by _optimizer_use_feedback.</p>
<p>Regards<br />
Vivek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Only Four Left&#8230; &#187; Recently relevant (to me) links</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-36527</link>
		<dc:creator><![CDATA[Only Four Left&#8230; &#187; Recently relevant (to me) links]]></dc:creator>
		<pubDate>Mon, 21 Jun 2010 22:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-36527</guid>
		<description><![CDATA[[...] Lewis&#039; review of a Collaborate &#039;09 presentation on tuning by cardinality feedback, and the slides from that presentation, helped me refresh my approach to a report tuning [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Lewis&#039; review of a Collaborate &#039;09 presentation on tuning by cardinality feedback, and the slides from that presentation, helped me refresh my approach to a report tuning [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Egor</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-33093</link>
		<dc:creator><![CDATA[Egor]]></dc:creator>
		<pubDate>Thu, 21 May 2009 06:24:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-33093</guid>
		<description><![CDATA[Gary,
Yes, and it looks like a trend, but it&#039;s still very limited.]]></description>
		<content:encoded><![CDATA[<p>Gary,<br />
Yes, and it looks like a trend, but it&#8217;s still very limited.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-33088</link>
		<dc:creator><![CDATA[Gary]]></dc:creator>
		<pubDate>Wed, 20 May 2009 22:39:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-33088</guid>
		<description><![CDATA[Egor, 
Isn&#039;t that what adaptive cursor sharing in 11g is about - alebit limited to circumstances where there may be skew relating to bind variables ?]]></description>
		<content:encoded><![CDATA[<p>Egor,<br />
Isn&#8217;t that what adaptive cursor sharing in 11g is about &#8211; alebit limited to circumstances where there may be skew relating to bind variables ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randolf Geist</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-33063</link>
		<dc:creator><![CDATA[Randolf Geist]]></dc:creator>
		<pubDate>Wed, 20 May 2009 09:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-33063</guid>
		<description><![CDATA[Jonathan,

I just wanted to point out that in cases where you have statements that take simply too long to complete for a full analysis e.g. using DBMS_XPLAN.DISPLAY_CURSOR, it still can be useful to run them with row source statistics enabled, because (at least in recent releases, e.g. 10.2.0.4) the row source statistics get refreshed even when canceling the execution after a while.

So using e.g. DBMS_XPLAN.DISPLAY_CURSOR on that incomplete execution reveals the part of the execution plan where the time was spent so far and allows to pinpoint any discrepancies in estimates and actual row source statistics without having to wait for the completion of the statement.

I guess this should have worked with Michelle&#039;s particular example, too.

Regards,
Randolf]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>I just wanted to point out that in cases where you have statements that take simply too long to complete for a full analysis e.g. using DBMS_XPLAN.DISPLAY_CURSOR, it still can be useful to run them with row source statistics enabled, because (at least in recent releases, e.g. 10.2.0.4) the row source statistics get refreshed even when canceling the execution after a while.</p>
<p>So using e.g. DBMS_XPLAN.DISPLAY_CURSOR on that incomplete execution reveals the part of the execution plan where the time was spent so far and allows to pinpoint any discrepancies in estimates and actual row source statistics without having to wait for the completion of the statement.</p>
<p>I guess this should have worked with Michelle&#8217;s particular example, too.</p>
<p>Regards,<br />
Randolf</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Egor</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-33061</link>
		<dc:creator><![CDATA[Egor]]></dc:creator>
		<pubDate>Wed, 20 May 2009 07:49:54 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-33061</guid>
		<description><![CDATA[Hi Jonathan,
Okay, we can compare E-rows and A-rows to find out where the problem lies. Wouldn&#039;t it be nice if Oracle could do this itself? After completing a query it can (theoretically) compare predicted and actual numbers and &quot;fine-tune&quot; statistics (probably new types of statistics) to reflect the difference. And the query will run faster next time, automagically.
Too fantastic? What do you think about it?]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,<br />
Okay, we can compare E-rows and A-rows to find out where the problem lies. Wouldn&#8217;t it be nice if Oracle could do this itself? After completing a query it can (theoretically) compare predicted and actual numbers and &#8220;fine-tune&#8221; statistics (probably new types of statistics) to reflect the difference. And the query will run faster next time, automagically.<br />
Too fantastic? What do you think about it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timur Akhmadeev</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-33001</link>
		<dc:creator><![CDATA[Timur Akhmadeev]]></dc:creator>
		<pubDate>Thu, 14 May 2009 17:08:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-33001</guid>
		<description><![CDATA[John,

Oracle can use DISTINCT_KEYS of an index for some cases to get more precise cardinality estimation in 10.2.0.4 (with additional setting). See &lt;a href=&quot;http://forums.oracle.com/forums/message.jspa?messageID=3371361&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; topic for details.]]></description>
		<content:encoded><![CDATA[<p>John,</p>
<p>Oracle can use DISTINCT_KEYS of an index for some cases to get more precise cardinality estimation in 10.2.0.4 (with additional setting). See <a href="http://forums.oracle.com/forums/message.jspa?messageID=3371361" rel="nofollow">this</a> topic for details.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-32993</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 14 May 2009 08:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-32993</guid>
		<description><![CDATA[James,

Correct - the &quot;multi-column&quot; variant of 11g&#039;s extended statistics would probably have worked in this case. 

We might have to be a little careful, though, as we can&#039;t be certain whether or not the number of distinct combinations was less than 255 - which would dictate whether we wanted to create a frequency histogram, or simply rely on the number of distinct combination.]]></description>
		<content:encoded><![CDATA[<p>James,</p>
<p>Correct &#8211; the &#8220;multi-column&#8221; variant of 11g&#8217;s extended statistics would probably have worked in this case. </p>
<p>We might have to be a little careful, though, as we can&#8217;t be certain whether or not the number of distinct combinations was less than 255 &#8211; which would dictate whether we wanted to create a frequency histogram, or simply rely on the number of distinct combination.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Park</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-32988</link>
		<dc:creator><![CDATA[James Park]]></dc:creator>
		<pubDate>Thu, 14 May 2009 03:00:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-32988</guid>
		<description><![CDATA[In 11g, isn&#039;t this also a candidate for extended statistics on a virtual column, as described in http://orainternals.wordpress.com/2008/12/19/correlation-nocorrelation-and-extended-stats/ ?]]></description>
		<content:encoded><![CDATA[<p>In 11g, isn&#8217;t this also a candidate for extended statistics on a virtual column, as described in <a href="http://orainternals.wordpress.com/2008/12/19/correlation-nocorrelation-and-extended-stats/" rel="nofollow">http://orainternals.wordpress.com/2008/12/19/correlation-nocorrelation-and-extended-stats/</a> ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/11/cardinality-feedback/#comment-32984</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 13 May 2009 19:18:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1203#comment-32984</guid>
		<description><![CDATA[John,

That is another possible strategy and, given how small the critical table, it&#039;s a good one to consider.

Just to emphasise your point - the intention is NOT to change a full tablescan into an indexed access path by creating an index, the intention is to tell the optimizer about the number of combinations available in the &lt;b&gt;distinct_keys&lt;/b&gt; statistic of the index.

Depending on the version of Oracle, and the uniqueness of the index, the &lt;b&gt;distinct_keys &lt;/b&gt; statistic can be used in various ways by the optimizer.]]></description>
		<content:encoded><![CDATA[<p>John,</p>
<p>That is another possible strategy and, given how small the critical table, it&#8217;s a good one to consider.</p>
<p>Just to emphasise your point &#8211; the intention is NOT to change a full tablescan into an indexed access path by creating an index, the intention is to tell the optimizer about the number of combinations available in the <b>distinct_keys</b> statistic of the index.</p>
<p>Depending on the version of Oracle, and the uniqueness of the index, the <b>distinct_keys </b> statistic can be used in various ways by the optimizer.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
