<?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/"
		>
<channel>
	<title>Comments on: Choosing An Optimal Stats Gathering Strategy</title>
	<atom:link href="http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/feed/" rel="self" type="application/rss+xml" />
	<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/</link>
	<description>Oracle Database Performance And Scalability Blog</description>
	<lastBuildDate>Mon, 01 Mar 2010 22:11:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 2009 Year-End Zeitgeist</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-11061</link>
		<dc:creator>2009 Year-End Zeitgeist</dc:creator>
		<pubDate>Mon, 04 Jan 2010 00:10:57 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-11061</guid>
		<description>[...] Choosing An Optimal Stats Gathering Strategy [...]</description>
		<content:encoded><![CDATA[<p>[...] Choosing An Optimal Stats Gathering Strategy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Happy Anniversary To The Structured Data Blog &#124; Structured Data</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-195</link>
		<dc:creator>Happy Anniversary To The Structured Data Blog &#124; Structured Data</dc:creator>
		<pubDate>Mon, 23 Feb 2009 15:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-195</guid>
		<description>[...] Choosing An Optimal Stats Gathering Strategy [...]</description>
		<content:encoded><![CDATA[<p>[...] Choosing An Optimal Stats Gathering Strategy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gathering Statistics &#171; Oracle Database Blog</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-200</link>
		<dc:creator>Gathering Statistics &#171; Oracle Database Blog</dc:creator>
		<pubDate>Tue, 06 Jan 2009 09:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-200</guid>
		<description>[...] http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/" rel="nofollow">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DBMS_STATS, METHOD_OPT and FOR ALL INDEXED COLUMNS &#124; Structured Data</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-201</link>
		<dc:creator>DBMS_STATS, METHOD_OPT and FOR ALL INDEXED COLUMNS &#124; Structured Data</dc:creator>
		<pubDate>Tue, 14 Oct 2008 08:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-201</guid>
		<description>[...] written before on choosing an optimal stats gathering strategy but I recently came across a scenario that I didn&#8217;t directly blog about and think it deserves [...]</description>
		<content:encoded><![CDATA[<p>[...] written before on choosing an optimal stats gathering strategy but I recently came across a scenario that I didn&#8217;t directly blog about and think it deserves [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-199</link>
		<dc:creator>Greg Rahn</dc:creator>
		<pubDate>Mon, 04 Aug 2008 11:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-199</guid>
		<description>@Randolf

Thanks much for sharing that scenario.  This is why it is extremely important to have a strategy that worka for you: what works for someone else, may not work for you due to limitations like this.  A similar  scenario is also true for 11g with the use of incremental stats: they can only be gathered on a partitioned table and would not work in a partition exchange scenario.</description>
		<content:encoded><![CDATA[<p>@Randolf</p>
<p>Thanks much for sharing that scenario.  This is why it is extremely important to have a strategy that worka for you: what works for someone else, may not work for you due to limitations like this.  A similar  scenario is also true for 11g with the use of incremental stats: they can only be gathered on a partitioned table and would not work in a partition exchange scenario.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randolf Geist</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-196</link>
		<dc:creator>Randolf Geist</dc:creator>
		<pubDate>Mon, 04 Aug 2008 10:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-196</guid>
		<description>Greg,

regarding the options mentioned how to gather statistics after bulk loading a partition:

&quot;Data is loaded into a staging table, stats are gathered, and the staging table is partition exchanged into the target table.&quot;

I think it could be worth to note that this option has to be checked carefully as it effectively disables the (default) SIZE AUTO feature introduced in 10g. So if you e.g. migrate from 9i to 10g and want to take advantage of the SIZE AUTO feature then the data loading needs to be changed in such a way that the statistics are gathered on the actual table (partition) after exchanging the partition. Otherwise the SIZE AUTO feature will be reduced to SIZE 1 as usually no (or may be even misleading) column usage of the staging table is used to gather the statistics.

I&#039;ve recently posted a note about this along with a test case here: &lt;a href=&quot;http://oracle-randolf.blogspot.com/2008/04/exchange-partition-and-size-auto-option.html&quot; rel=&quot;nofollow&quot;&gt;Exchange partition and the SIZE AUTO option of DBMS_STATS&lt;/a&gt;

Regards,
Randolf</description>
		<content:encoded><![CDATA[<p>Greg,</p>
<p>regarding the options mentioned how to gather statistics after bulk loading a partition:</p>
<p>&#8220;Data is loaded into a staging table, stats are gathered, and the staging table is partition exchanged into the target table.&#8221;</p>
<p>I think it could be worth to note that this option has to be checked carefully as it effectively disables the (default) SIZE AUTO feature introduced in 10g. So if you e.g. migrate from 9i to 10g and want to take advantage of the SIZE AUTO feature then the data loading needs to be changed in such a way that the statistics are gathered on the actual table (partition) after exchanging the partition. Otherwise the SIZE AUTO feature will be reduced to SIZE 1 as usually no (or may be even misleading) column usage of the staging table is used to gather the statistics.</p>
<p>I&#8217;ve recently posted a note about this along with a test case here: <a href="http://oracle-randolf.blogspot.com/2008/04/exchange-partition-and-size-auto-option.html" rel="nofollow">Exchange partition and the SIZE AUTO option of DBMS_STATS</a></p>
<p>Regards,<br />
Randolf</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-187</link>
		<dc:creator>Greg Rahn</dc:creator>
		<pubDate>Wed, 23 Jul 2008 20:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-187</guid>
		<description>@Raj

You are correct.  If &lt;code&gt;cascade=&gt;true&lt;/code&gt; then index stats are also gathered using the specified &lt;code&gt;estimate_precent&lt;/code&gt;.  If &lt;code&gt;cascade=&gt;false&lt;/code&gt; then only table stats are collected, not index stats.

I am not sure what you mean by &quot;best&quot; (what is your goal?), but when index statistics are gathered as part of a table statistics collection, they are gathered serially, one after another.  If you wish to consume more resources to shorten the duration of the collection, you could gather index statistics separately using &lt;code&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1036276&quot; rel=&quot;nofollow&quot;&gt;DBMS_STATS.GATHER_INDEX_STATS&lt;/a&gt;&lt;/code&gt; in multiple, concurrent database sessions.  You can select the granularity that works for you: table at time or index at a time.</description>
		<content:encoded><![CDATA[<p>@Raj</p>
<p>You are correct.  If <code>cascade=>true</code> then index stats are also gathered using the specified <code>estimate_precent</code>.  If <code>cascade=>false</code> then only table stats are collected, not index stats.</p>
<p>I am not sure what you mean by &#8220;best&#8221; (what is your goal?), but when index statistics are gathered as part of a table statistics collection, they are gathered serially, one after another.  If you wish to consume more resources to shorten the duration of the collection, you could gather index statistics separately using <code><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1036276" rel="nofollow">DBMS_STATS.GATHER_INDEX_STATS</a></code> in multiple, concurrent database sessions.  You can select the granularity that works for you: table at time or index at a time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raj</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-186</link>
		<dc:creator>raj</dc:creator>
		<pubDate>Tue, 22 Jul 2008 19:58:52 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-186</guid>
		<description>Hi Greg,

When gathering stats with dbms_stats, I think I&#039;m understanding that if cascade=&gt;false, then index stats, for the related tables, will not be gathered. But if cascade=&gt;true, then the estimate_percent listed will also be used for the related indexes.  Is this correct?

If so, what is the best way to compute stats on all related indexes for a table... irrelevant of the estimate_percent used?</description>
		<content:encoded><![CDATA[<p>Hi Greg,</p>
<p>When gathering stats with dbms_stats, I think I&#8217;m understanding that if cascade=&gt;false, then index stats, for the related tables, will not be gathered. But if cascade=&gt;true, then the estimate_percent listed will also be used for the related indexes.  Is this correct?</p>
<p>If so, what is the best way to compute stats on all related indexes for a table&#8230; irrelevant of the estimate_percent used?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Appunti sul funzionamento di CBO in Oracle &#171; Oracle and other</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-184</link>
		<dc:creator>Appunti sul funzionamento di CBO in Oracle &#171; Oracle and other</dc:creator>
		<pubDate>Wed, 25 Jun 2008 16:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-184</guid>
		<description>[...] articolo/post sull&#8217;argomento ottimizzatore Oracle CBO, bind peeking, istogrammi (&#8221;Choosing an optimal stats gathering strategy&#8220;). Quello che faccio ancora fatica  a digerire è la tesi, sostenuta da molti, che uno dei [...]</description>
		<content:encoded><![CDATA[<p>[...] articolo/post sull&#8217;argomento ottimizzatore Oracle CBO, bind peeking, istogrammi (&#8221;Choosing an optimal stats gathering strategy&#8220;). Quello che faccio ancora fatica  a digerire è la tesi, sostenuta da molti, che uno dei [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/comment-page-1/#comment-185</link>
		<dc:creator>Greg Rahn</dc:creator>
		<pubDate>Wed, 28 May 2008 19:54:05 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/#comment-185</guid>
		<description>Mark-

To be more precise, it is probably not a good idea to use bind variable predicates on columns on which a histogram exists.  It is plausible to use histograms in an OLTP system, if the application uses a literal value for that column in the predicate and not a bind value.  Perhaps this is where the confusion came in.  It is not a global binary &quot;use&quot; or &quot;don&#039;t use&quot;, but rather a &quot;don&#039;t use together for a given column.&quot;    Hopefully that adds some clarity.  For this reason, I suggested to use REPEAT; for the case where a histogram is desired and the application has been modified to use a literal value.  Using &quot;SIZE 1&quot; would remove the desired histogram on subsequent stats gathers.

From what I have seen, bind peeking in itself does not generally seem to present an issue.  I would guess that for the most part an equal or better plan can be chosen using bind peeking.  Of course, this discounts the cases when histograms exist.  Given this, would you be inclined to blame bind peeking?  I personally do not.  This is why my position is not to disable bind peeking, but rather control the collection of histograms to avoid the issue that arises from the combination of the two, for a given column.</description>
		<content:encoded><![CDATA[<p>Mark-</p>
<p>To be more precise, it is probably not a good idea to use bind variable predicates on columns on which a histogram exists.  It is plausible to use histograms in an OLTP system, if the application uses a literal value for that column in the predicate and not a bind value.  Perhaps this is where the confusion came in.  It is not a global binary &#8220;use&#8221; or &#8220;don&#8217;t use&#8221;, but rather a &#8220;don&#8217;t use together for a given column.&#8221;    Hopefully that adds some clarity.  For this reason, I suggested to use REPEAT; for the case where a histogram is desired and the application has been modified to use a literal value.  Using &#8220;SIZE 1&#8243; would remove the desired histogram on subsequent stats gathers.</p>
<p>From what I have seen, bind peeking in itself does not generally seem to present an issue.  I would guess that for the most part an equal or better plan can be chosen using bind peeking.  Of course, this discounts the cases when histograms exist.  Given this, would you be inclined to blame bind peeking?  I personally do not.  This is why my position is not to disable bind peeking, but rather control the collection of histograms to avoid the issue that arises from the combination of the two, for a given column.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
