<?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: Troubleshooting Bad Execution Plans</title>
	<atom:link href="http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/feed/" rel="self" type="application/rss+xml" />
	<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=troubleshooting-bad-execution-plans</link>
	<description>Data, Databases, Performance &#38; Scalability</description>
	<lastBuildDate>Mon, 30 Jan 2012 17:05:12 -0500</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kerry Osborne&#8217;s Oracle Blog &#187; Blog Archive &#187; GATHER_PLAN_STATISTICS &#8211; Kerry Osborne’s Oracle Blog</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-17065</link>
		<dc:creator>Kerry Osborne&#8217;s Oracle Blog &#187; Blog Archive &#187; GATHER_PLAN_STATISTICS &#8211; Kerry Osborne’s Oracle Blog</dc:creator>
		<pubDate>Fri, 25 Mar 2011 14:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-17065</guid>
		<description>[...] to compare apples to apples. If you need a little more info see this post by Jonathan Lewis or this one by Greg Rahn. Here&#8217;s how the output looks in case you haven&#8217;t seen it before: ?View Code [...]</description>
		<content:encoded><![CDATA[<p>[...] to compare apples to apples. If you need a little more info see this post by Jonathan Lewis or this one by Greg Rahn. Here&#8217;s how the output looks in case you haven&#8217;t seen it before: ?View Code [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-12513</link>
		<dc:creator>Greg Rahn</dc:creator>
		<pubDate>Mon, 16 Aug 2010 06:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-12513</guid>
		<description>@Golden Orbit

Out of date stats can easily be a problem.  It&#039;s imperative to the the query optimizer accurate information, so I&#039;d recommend you collect stats that are representative.

Your friends sound like they insist on fighting symptoms rather than addressing root cause.  If the distribution being chosen is broadcast, then the cardinality estimate is low.  Whether or not that is accurate is a different discussion.  Histograms are really not all that useful for OLTP systems that use bind variables as they don&#039;t really mix well.  On one hand you want to reuse plans for queries/cursors, but then with a histogram you are basically saying - I want different plans for different values.  See how those two don&#039;t mix?  Simply put, histograms will matter where there is data skew - and that is quite common in data warehouses.

If you want to convince your DBA friends just have them refresh the stats.  If they are so sure it won&#039;t matter, then they should have no objection to proving it.  :)</description>
		<content:encoded><![CDATA[<p>@Golden Orbit</p>
<p>Out of date stats can easily be a problem.  It&#8217;s imperative to the the query optimizer accurate information, so I&#8217;d recommend you collect stats that are representative.</p>
<p>Your friends sound like they insist on fighting symptoms rather than addressing root cause.  If the distribution being chosen is broadcast, then the cardinality estimate is low.  Whether or not that is accurate is a different discussion.  Histograms are really not all that useful for OLTP systems that use bind variables as they don&#8217;t really mix well.  On one hand you want to reuse plans for queries/cursors, but then with a histogram you are basically saying &#8211; I want different plans for different values.  See how those two don&#8217;t mix?  Simply put, histograms will matter where there is data skew &#8211; and that is quite common in data warehouses.</p>
<p>If you want to convince your DBA friends just have them refresh the stats.  If they are so sure it won&#8217;t matter, then they should have no objection to proving it.  :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Golden Orbit</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-12512</link>
		<dc:creator>Golden Orbit</dc:creator>
		<pubDate>Mon, 16 Aug 2010 06:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-12512</guid>
		<description>I am dealing with a very big DW implementation (10g and 11g) with over 200TB data, and I noticed that some out-of-date histograms for the columns, which are used in the &quot;column_name = :value1&quot; kind of filter, are causing very bad estimation of cardinality in CBO. Oracle thinks the data set is small, and tends to broadcast that data set in a hash join.

But my DBA friends insist in using PQ_DISTRIBUTE() hints to force (hash,hash) distribution to avoid (broadcast, none) distribution. They strongly believe that HISTOGRAMS are more useful for OLTP systems, they do not matter in DW. I have witnessed quite some DW performance issues in 10g because of lacking of histograms or using wrong histograms, but how can I convince those DBAs to at least refresh the histograms for certain columns?</description>
		<content:encoded><![CDATA[<p>I am dealing with a very big DW implementation (10g and 11g) with over 200TB data, and I noticed that some out-of-date histograms for the columns, which are used in the &#8220;column_name = :value1&#8243; kind of filter, are causing very bad estimation of cardinality in CBO. Oracle thinks the data set is small, and tends to broadcast that data set in a hash join.</p>
<p>But my DBA friends insist in using PQ_DISTRIBUTE() hints to force (hash,hash) distribution to avoid (broadcast, none) distribution. They strongly believe that HISTOGRAMS are more useful for OLTP systems, they do not matter in DW. I have witnessed quite some DW performance issues in 10g because of lacking of histograms or using wrong histograms, but how can I convince those DBAs to at least refresh the histograms for certain columns?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Managing Optimizer Statistics Paper &#124; Structured Data</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-92</link>
		<dc:creator>Managing Optimizer Statistics Paper &#124; Structured Data</dc:creator>
		<pubDate>Mon, 16 Feb 2009 09:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-92</guid>
		<description>[...] Troubleshooting Bad Execution Plans [...]</description>
		<content:encoded><![CDATA[<p>[...] Troubleshooting Bad Execution Plans [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-89</link>
		<dc:creator>Greg Rahn</dc:creator>
		<pubDate>Sun, 08 Feb 2009 06:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-89</guid>
		<description>@Hrishy

Thank you and I think that dissecting execution plans would make a great blog post.  I shall add that to my list of ideas.  Thanks again.</description>
		<content:encoded><![CDATA[<p>@Hrishy</p>
<p>Thank you and I think that dissecting execution plans would make a great blog post.  I shall add that to my list of ideas.  Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hrishy</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-88</link>
		<dc:creator>hrishy</dc:creator>
		<pubDate>Sun, 08 Feb 2009 05:24:48 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-88</guid>
		<description>Hi Greg

Wow you certainly are a great teacher .
was wondering if that dissection would be an item of your next blog under the heading troubleshooting bad execution plans by dissecting the joins one step at a time.

excellent piece of advise by the way.

regards
Hrishy</description>
		<content:encoded><![CDATA[<p>Hi Greg</p>
<p>Wow you certainly are a great teacher .<br />
was wondering if that dissection would be an item of your next blog under the heading troubleshooting bad execution plans by dissecting the joins one step at a time.</p>
<p>excellent piece of advise by the way.</p>
<p>regards<br />
Hrishy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-91</link>
		<dc:creator>Greg Rahn</dc:creator>
		<pubDate>Sun, 08 Feb 2009 00:41:16 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-91</guid>
		<description>@Hrishy

You can cancel a query and still call dbms_xplan.display_cursor(format=&gt;&#039;allstats last&#039;), and it will display the actual rows it returned &lt;em&gt;&lt;strong&gt;thus far&lt;/strong&gt;&lt;/em&gt; for the row sources that have been executed &lt;em&gt;&lt;strong&gt;thus far&lt;/strong&gt;&lt;/em&gt;, but I&#039;m not certain this will be of much use.  I would liken it to trying to find out how many rows a query returns without actually running the query.  A database does not know how many rows will be returned until there are no more rows to be fetched.

What I would recommend in your case is to break the query into bite size chunks.  Start with single table predicates and validate the estimates are reasonable.  Then start with a 2 table join, validating the cardinality again.  Add one more table, and validate again.  Keep doing this until you find the join where the cardinality estimates go wrong.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>@Hrishy</p>
<p>You can cancel a query and still call dbms_xplan.display_cursor(format=&gt;&#8217;allstats last&#8217;), and it will display the actual rows it returned <em><strong>thus far</strong></em> for the row sources that have been executed <em><strong>thus far</strong></em>, but I&#8217;m not certain this will be of much use.  I would liken it to trying to find out how many rows a query returns without actually running the query.  A database does not know how many rows will be returned until there are no more rows to be fetched.</p>
<p>What I would recommend in your case is to break the query into bite size chunks.  Start with single table predicates and validate the estimates are reasonable.  Then start with a 2 table join, validating the cardinality again.  Add one more table, and validate again.  Keep doing this until you find the join where the cardinality estimates go wrong.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hrishy</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-90</link>
		<dc:creator>hrishy</dc:creator>
		<pubDate>Sat, 07 Feb 2009 17:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-90</guid>
		<description>Hi Greg

I notice that the gather_plan_statistics hint that you use to have look at the actual and estimated cardinality requires that the sql run to completion and only then the call to the dbms_xplan.display_cursor is made .

If my query takes an hour or so and i am one of those impatient types would it be possible for me to do a control +C on the query and then make a call to the dbms_xplan.display_cursor to reveal the estimated and actual cardinalities .(don&#039;t have accesses to oracle at the moment so i am not able to verify this)or is their any other method


regards
Hrishy</description>
		<content:encoded><![CDATA[<p>Hi Greg</p>
<p>I notice that the gather_plan_statistics hint that you use to have look at the actual and estimated cardinality requires that the sql run to completion and only then the call to the dbms_xplan.display_cursor is made .</p>
<p>If my query takes an hour or so and i am one of those impatient types would it be possible for me to do a control +C on the query and then make a call to the dbms_xplan.display_cursor to reveal the estimated and actual cardinalities .(don&#8217;t have accesses to oracle at the moment so i am not able to verify this)or is their any other method</p>
<p>regards<br />
Hrishy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DBMS_STATS, METHOD_OPT and FOR ALL INDEXED COLUMNS &#124; Structured Data</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-72</link>
		<dc:creator>DBMS_STATS, METHOD_OPT and FOR ALL INDEXED COLUMNS &#124; Structured Data</dc:creator>
		<pubDate>Tue, 14 Oct 2008 15:51:54 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-72</guid>
		<description>[...] where to find column statistics is vital for troubleshooting bad execution plans. These views will be the arrows in your [...]</description>
		<content:encoded><![CDATA[<p>[...] where to find column statistics is vital for troubleshooting bad execution plans. These views will be the arrows in your [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OracleFromFrance</title>
		<link>http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-87</link>
		<dc:creator>OracleFromFrance</dc:creator>
		<pubDate>Fri, 03 Oct 2008 09:40:40 +0000</pubDate>
		<guid isPermaLink="false">http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/#comment-87</guid>
		<description>Hi,
I have the following Question:
Can you give us a good link or document explain the meaning of the &quot;&#124;Starts&#124;&quot; column:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                                   &#124; Name                       &#124; Starts &#124; E-Rows &#124; A-Rows &#124;   A-Time   &#124; Buffers &#124;  OMem &#124;  1Mem &#124; Used-Mem &#124;
---------------------------------------------------------------------------------------------------------------------------------------------------------------</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have the following Question:<br />
Can you give us a good link or document explain the meaning of the &#8220;|Starts|&#8221; column:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| Id  | Operation                                   | Name                       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/3 queries in 0.001 seconds using disk: basic
Object Caching 406/407 objects using disk: basic

Served from: structureddata.org @ 2012-02-09 18:06:04 -->
