<?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: Explain Plan &#8211; Which Plan is Better</title>
	<atom:link href="http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/</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/01/29/explain-plan-which-plan-is-better/#comment-4840</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 18 Jul 2012 11:04:08 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-4840</guid>
		<description><![CDATA[Ravindra,

First, a little friendly advice.  When communicating on blogs, Internet forums, and other places on the Internet where information is shared with people from many different countries with primary languages other than English, please refrain from using uncommon abbreviations for words.  Text message abbreviations, such as &quot;u&quot;, do not translate well into languages other than English, making it difficult for non-native English readers to understand and assist with any problems that you share with the world through blogs and Internet forums.

Second, it appears that you have generated four execution plans, one of which has a calculated cost that is roughly 10 times higher than the calculated cost that appears in the other execution plans.  The calculated cost is used by the optimizer when developing the execution plan.  While the calculated cost is intended to indicate to the Oracle query optimizer the approximate amount of time required to execute a particular portion of the execution plan (see http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/ ), that calculated cost estimate may be miscalculated due to various factors including out of date object statistics, missing or inappropriate histograms, bind variable peeking / or not peeking, silly mistakes in queries (such as unnecessary implicit data type conversions, unnecessary using a function such as TRUNC on a column in a WHERE clause, etc.), inappropriate system (CPU) statistics, etc.

While it is important for the query optimizer to reasonably acurately calculate the cost of an execution plan, it makes little difference if the cost of a full table scan is 1, 63,295, or 1,000,000,000 if a full table scan is the only &quot;legal&quot; method to retrieve the data from the table due to missing indexes, inappropriate indexes (such as those with a high clustering factor that are not very selective), or indexes that cannot be used due to a mistake in the query (implicit data type conversion, using a function such as TRUNC on the indexed column, etc.).  

The &quot;Predicate Information&quot; section of an execution plan (found in execution plans when generated with recent Oracle client versions and Oracle Database versions) may provide valuable information regarding mistakes in a particular query that resulted in an unexpected operation in an execution plan.

In short, do not tune by attempting to make a query&#039;s calculated cost as low as possible.  The calculated cost is only an estimate, and if that estimate does not reflect the actual resource utilization to perform an operation in an execution plan, the calculated cost is just a number that is meaningless for improving efficiency.  Use actual timing (a 10046 trace is great for such timing), run time statistics, etc. rather than the calculated cost.]]></description>
		<content:encoded><![CDATA[<p>Ravindra,</p>
<p>First, a little friendly advice.  When communicating on blogs, Internet forums, and other places on the Internet where information is shared with people from many different countries with primary languages other than English, please refrain from using uncommon abbreviations for words.  Text message abbreviations, such as &#8220;u&#8221;, do not translate well into languages other than English, making it difficult for non-native English readers to understand and assist with any problems that you share with the world through blogs and Internet forums.</p>
<p>Second, it appears that you have generated four execution plans, one of which has a calculated cost that is roughly 10 times higher than the calculated cost that appears in the other execution plans.  The calculated cost is used by the optimizer when developing the execution plan.  While the calculated cost is intended to indicate to the Oracle query optimizer the approximate amount of time required to execute a particular portion of the execution plan (see <a href="http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/" rel="nofollow">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/</a> ), that calculated cost estimate may be miscalculated due to various factors including out of date object statistics, missing or inappropriate histograms, bind variable peeking / or not peeking, silly mistakes in queries (such as unnecessary implicit data type conversions, unnecessary using a function such as TRUNC on a column in a WHERE clause, etc.), inappropriate system (CPU) statistics, etc.</p>
<p>While it is important for the query optimizer to reasonably acurately calculate the cost of an execution plan, it makes little difference if the cost of a full table scan is 1, 63,295, or 1,000,000,000 if a full table scan is the only &#8220;legal&#8221; method to retrieve the data from the table due to missing indexes, inappropriate indexes (such as those with a high clustering factor that are not very selective), or indexes that cannot be used due to a mistake in the query (implicit data type conversion, using a function such as TRUNC on the indexed column, etc.).  </p>
<p>The &#8220;Predicate Information&#8221; section of an execution plan (found in execution plans when generated with recent Oracle client versions and Oracle Database versions) may provide valuable information regarding mistakes in a particular query that resulted in an unexpected operation in an execution plan.</p>
<p>In short, do not tune by attempting to make a query&#8217;s calculated cost as low as possible.  The calculated cost is only an estimate, and if that estimate does not reflect the actual resource utilization to perform an operation in an execution plan, the calculated cost is just a number that is meaningless for improving efficiency.  Use actual timing (a 10046 trace is great for such timing), run time statistics, etc. rather than the calculated cost.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravindra</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-4839</link>
		<dc:creator><![CDATA[Ravindra]]></dc:creator>
		<pubDate>Wed, 18 Jul 2012 07:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-4839</guid>
		<description><![CDATA[Hi Friends,
I have generated one explain plan, it is taking a huge cost.
&lt;pre&gt;
-------------------------------------------------------------------
&#124; Id  &#124; Operation          &#124; Name         &#124; Rows  &#124; Bytes &#124; Cost  &#124;
-------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT   &#124;              &#124;     1 &#124;   155 &#124;  6509 &#124;
&#124;   1 &#124;  NESTED LOOPS      &#124;              &#124;     1 &#124;   155 &#124;  6509 &#124;
&#124;   2 &#124;   TABLE ACCESS FULL&#124; TANCASE_INFO &#124;     1 &#124;   149 &#124;  6508 &#124;
&#124;   3 &#124;   INDEX UNIQUE SCAN&#124; PK_CASE_ID   &#124;     1 &#124;     6 &#124;     1 &#124;
-------------------------------------------------------------------

-----------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name        &#124; Rows  &#124; Bytes &#124; Cost  &#124;
-----------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;             &#124;     2 &#124;   302 &#124; 63295 &#124;
&#124;   1 &#124;  TABLE ACCESS FULL&#124; TANWOB_EVNT &#124;     2 &#124;   302 &#124; 63295 &#124;
-----------------------------------------------------------------

------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name   &#124; Rows  &#124; Bytes &#124; Cost  &#124;
------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;        &#124;     1 &#124;    56 &#124;  2978 &#124;
&#124;   1 &#124;  TABLE ACCESS FULL&#124; TANWOB &#124;     1 &#124;    56 &#124;  2978 &#124;
------------------------------------------------------------

-------------------------------------------------------------
&#124; Id  &#124; Operation         &#124; Name    &#124; Rows  &#124; Bytes &#124; Cost  &#124;
-------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT  &#124;         &#124;     1 &#124;    90 &#124;  3988 &#124;
&#124;   1 &#124;  TABLE ACCESS FULL&#124; TANCASE &#124;     1 &#124;    90 &#124;  3988 &#124;
-------------------------------------------------------------
&lt;/pre&gt;
Can u please some one help me, to reduce the cost. 

Regards
Ravindra]]></description>
		<content:encoded><![CDATA[<p>Hi Friends,<br />
I have generated one explain plan, it is taking a huge cost.</p>
<pre>
-------------------------------------------------------------------
| Id  | Operation          | Name         | Rows  | Bytes | Cost  |
-------------------------------------------------------------------
|   0 | SELECT STATEMENT   |              |     1 |   155 |  6509 |
|   1 |  NESTED LOOPS      |              |     1 |   155 |  6509 |
|   2 |   TABLE ACCESS FULL| TANCASE_INFO |     1 |   149 |  6508 |
|   3 |   INDEX UNIQUE SCAN| PK_CASE_ID   |     1 |     6 |     1 |
-------------------------------------------------------------------

-----------------------------------------------------------------
| Id  | Operation         | Name        | Rows  | Bytes | Cost  |
-----------------------------------------------------------------
|   0 | SELECT STATEMENT  |             |     2 |   302 | 63295 |
|   1 |  TABLE ACCESS FULL| TANWOB_EVNT |     2 |   302 | 63295 |
-----------------------------------------------------------------

------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost  |
------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |     1 |    56 |  2978 |
|   1 |  TABLE ACCESS FULL| TANWOB |     1 |    56 |  2978 |
------------------------------------------------------------

-------------------------------------------------------------
| Id  | Operation         | Name    | Rows  | Bytes | Cost  |
-------------------------------------------------------------
|   0 | SELECT STATEMENT  |         |     1 |    90 |  3988 |
|   1 |  TABLE ACCESS FULL| TANCASE |     1 |    90 |  3988 |
-------------------------------------------------------------
</pre>
<p>Can u please some one help me, to reduce the cost. </p>
<p>Regards<br />
Ravindra</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Log Buffer #177: a Carnival of the Vanities for DBAs &#124; The Pythian Blog</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-313</link>
		<dc:creator><![CDATA[Log Buffer #177: a Carnival of the Vanities for DBAs &#124; The Pythian Blog]]></dc:creator>
		<pubDate>Fri, 05 Feb 2010 19:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-313</guid>
		<description><![CDATA[[...] Hooper grapples the question, Which Plan is Better? Charles writes, &#8220;A recent post appeared in the OTN forums that indirectly asked the question: [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Hooper grapples the question, Which Plan is Better? Charles writes, &#8220;A recent post appeared in the OTN forums that indirectly asked the question: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daily Roundup of News, Tips and Tricks &#8211; 2010-01-31 &#124; Eddie Awad's Blog</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-278</link>
		<dc:creator><![CDATA[Daily Roundup of News, Tips and Tricks &#8211; 2010-01-31 &#124; Eddie Awad's Blog]]></dc:creator>
		<pubDate>Mon, 01 Feb 2010 06:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-278</guid>
		<description><![CDATA[[...] when it comes to computer systems and performance you should read these articles by Cary Millsap.  Explain Plan – Which Plan is Better Which execution plan is better? Are the plans the same? How are they the same, and how do they [...]]]></description>
		<content:encoded><![CDATA[<p>[...] when it comes to computer systems and performance you should read these articles by Cary Millsap.  Explain Plan – Which Plan is Better Which execution plan is better? Are the plans the same? How are they the same, and how do they [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narendra</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-263</link>
		<dc:creator><![CDATA[Narendra]]></dc:creator>
		<pubDate>Sat, 30 Jan 2010 12:15:25 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-263</guid>
		<description><![CDATA[Charles,

My intention was not to say ALWAYS IGNORE THE COST. But as I mentioned as a question in my earlier response, is looking at the cost right way to start the performance tuning process ? I believe not.]]></description>
		<content:encoded><![CDATA[<p>Charles,</p>
<p>My intention was not to say ALWAYS IGNORE THE COST. But as I mentioned as a question in my earlier response, is looking at the cost right way to start the performance tuning process ? I believe not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-259</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Sat, 30 Jan 2010 00:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-259</guid>
		<description><![CDATA[Narendra, I very rarely read threads on asktom.  However, for some reason I recall reading that thread a couple of years ago.  Thanks for posting the link to that thread.  The first followup in that thread very clearly stated the point I was trying to make (my point might have been partially formed from reading this asktom thread years ago).

I do wonder about the un-named fan who posted the following on June 14, 2002:
&quot;Comparing the same query using COST is perfect legitimate because that is what the COST is for.  What we expect is the optimizer to permute all possible combinations and pick up the plan with the least cost.  If you could rewrite the same SQL to get a cheaper cost theoretically it should be faster.  If it is not I guess it is an optimizer bug.  Also if the COST is not just based on logical reads but on the CPU, then comparing the SQL in the same instance is still legitimate.&quot;

And then the follow-up by apparently the same un-named fan on June 27, 2002:
&quot;Ok, let me rephrase this again.  You can compare the same SQL when you are trying to tune that SQL.  If you can tune the SQL to get a lower cost than whatever CBO comes up with, it should perform better (lets not get to the run time because it depends on the physical characteristics like file system, disk speed etc.)  I&#039;m not wishing CBO to behave like this but thats how CBO works.

Cost CANNOT be treated as a random number.  Till 8i Cost is a metric based on the I/O (logical reads) and starting 9i there is an option to make the Cost based on CPU also along with I/O (calling the API DBMS_STATS.GATHER_SYSTEM_STATS)

The very fact COST is exposed is to give the user an idea about the unit of work or resource it is estimating to use for the SQL...

I&#039;m not saying all the above after reading from a manual.  I&#039;ve been working on CBO for couple of years and I&#039;m saying the above from my experience.  I can also reiterate, if you can come up a tuned SQL where the COST is cheaper than the default CBO plan, then it is a CBO bug.  It is not what I wish, it is how it is.&quot;

One has to wonder what that un-named person had read, and possibly what else that person had authored based on their experience.  Apparently, some of that information is still being taught or read some where.

From the first followup in the thread:
&quot;When we get a query, we come up with lots of plans. Each step of the plan is assigned some relative cost.  At the end, we apply a function to derive the total cost of that query for each plan.  These costs (which are ONLY visible to the optimizer) can be compared as they are for the same exact SQL using the same exact environment.&quot;

I think that it should be stated that the calculated cost is compared at *each* step of the execution plan, and that the lowest calculated cost at that stage of the plan is selected.  The selection of the lowest cost-based decision at one step in a plan can cause later steps in the plan to generate higher calculated costs, such that the total cost output for the query could be significantly greater than if the cost-based optimizer selected a higher cost join or access path earlier in the execution plan.  Thus, for queries with several row sources (tables, indexes, or previous join results), you probably should not compare the costs that are output with an execution plan when a different join order is used or when a different access path is selected.

Of course, the cost is time argument does make some sense (to me) at individual stages of an execution plan.]]></description>
		<content:encoded><![CDATA[<p>Narendra, I very rarely read threads on asktom.  However, for some reason I recall reading that thread a couple of years ago.  Thanks for posting the link to that thread.  The first followup in that thread very clearly stated the point I was trying to make (my point might have been partially formed from reading this asktom thread years ago).</p>
<p>I do wonder about the un-named fan who posted the following on June 14, 2002:<br />
&#8220;Comparing the same query using COST is perfect legitimate because that is what the COST is for.  What we expect is the optimizer to permute all possible combinations and pick up the plan with the least cost.  If you could rewrite the same SQL to get a cheaper cost theoretically it should be faster.  If it is not I guess it is an optimizer bug.  Also if the COST is not just based on logical reads but on the CPU, then comparing the SQL in the same instance is still legitimate.&#8221;</p>
<p>And then the follow-up by apparently the same un-named fan on June 27, 2002:<br />
&#8220;Ok, let me rephrase this again.  You can compare the same SQL when you are trying to tune that SQL.  If you can tune the SQL to get a lower cost than whatever CBO comes up with, it should perform better (lets not get to the run time because it depends on the physical characteristics like file system, disk speed etc.)  I&#8217;m not wishing CBO to behave like this but thats how CBO works.</p>
<p>Cost CANNOT be treated as a random number.  Till 8i Cost is a metric based on the I/O (logical reads) and starting 9i there is an option to make the Cost based on CPU also along with I/O (calling the API DBMS_STATS.GATHER_SYSTEM_STATS)</p>
<p>The very fact COST is exposed is to give the user an idea about the unit of work or resource it is estimating to use for the SQL&#8230;</p>
<p>I&#8217;m not saying all the above after reading from a manual.  I&#8217;ve been working on CBO for couple of years and I&#8217;m saying the above from my experience.  I can also reiterate, if you can come up a tuned SQL where the COST is cheaper than the default CBO plan, then it is a CBO bug.  It is not what I wish, it is how it is.&#8221;</p>
<p>One has to wonder what that un-named person had read, and possibly what else that person had authored based on their experience.  Apparently, some of that information is still being taught or read some where.</p>
<p>From the first followup in the thread:<br />
&#8220;When we get a query, we come up with lots of plans. Each step of the plan is assigned some relative cost.  At the end, we apply a function to derive the total cost of that query for each plan.  These costs (which are ONLY visible to the optimizer) can be compared as they are for the same exact SQL using the same exact environment.&#8221;</p>
<p>I think that it should be stated that the calculated cost is compared at *each* step of the execution plan, and that the lowest calculated cost at that stage of the plan is selected.  The selection of the lowest cost-based decision at one step in a plan can cause later steps in the plan to generate higher calculated costs, such that the total cost output for the query could be significantly greater than if the cost-based optimizer selected a higher cost join or access path earlier in the execution plan.  Thus, for queries with several row sources (tables, indexes, or previous join results), you probably should not compare the costs that are output with an execution plan when a different join order is used or when a different access path is selected.</p>
<p>Of course, the cost is time argument does make some sense (to me) at individual stages of an execution plan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narendra</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-254</link>
		<dc:creator><![CDATA[Narendra]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 14:08:07 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-254</guid>
		<description><![CDATA[Timur/ Charles,
&gt;Well, on the other hand, one who understand what is the cost, what cost-based
&gt;optimizer is and what’s behind CBO calculations, tend to carefully compare the
&gt;figures reported by explain plan.

Unfortunately, those who understand what is the cost, what is CBO and what is behind CBO&#039;s calculations are far less compared to those who don&#039;t. Hence there is a risk of such statements easily being (incorrectly) translated as &quot;Cost is the (only) &quot;Holy Grail&quot; to performance tuning in oracle&quot;. Even if the forum post mentioned here, it should be noted that the 2 query plans have been generated by 2 queries that are not same. Now, would it be right to start the tuning process by comparing the costs (and trying to figure out how they are calculated) or start tuning process by identifying WHY does the query need to be hinted in the first place (if hinted query generates more attractive plan) ?
An old asktom thread comes to mind (and I agree with Tom):
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:313416745628]]></description>
		<content:encoded><![CDATA[<p>Timur/ Charles,<br />
&gt;Well, on the other hand, one who understand what is the cost, what cost-based<br />
&gt;optimizer is and what’s behind CBO calculations, tend to carefully compare the<br />
&gt;figures reported by explain plan.</p>
<p>Unfortunately, those who understand what is the cost, what is CBO and what is behind CBO&#8217;s calculations are far less compared to those who don&#8217;t. Hence there is a risk of such statements easily being (incorrectly) translated as &#8220;Cost is the (only) &#8220;Holy Grail&#8221; to performance tuning in oracle&#8221;. Even if the forum post mentioned here, it should be noted that the 2 query plans have been generated by 2 queries that are not same. Now, would it be right to start the tuning process by comparing the costs (and trying to figure out how they are calculated) or start tuning process by identifying WHY does the query need to be hinted in the first place (if hinted query generates more attractive plan) ?<br />
An old asktom thread comes to mind (and I agree with Tom):<br />
<a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0" rel="nofollow">http://asktom.oracle.com/pls/asktom/f?p=100:11:0</a>::::P11_QUESTION_ID:313416745628</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-253</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 12:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-253</guid>
		<description><![CDATA[Anand, one of the questions that seems to be brought up in discussion forums somewhat frequently is: &quot;the cost for this plan is too high, how can I lower the cost?&quot;  It is important to keep in mind that the cost figure that appears in explain plans is just an estimate.
* If the optimizer estimates incorrectly the number of rows that will be returned from a result set, the calculated cost will be incorrect.  This could happen if statistics have not been collected recently for tables and indexes, or if some of the columns are correlated (not truly independent), or if the wrong data type is selected for a column (or bind variable definition), or functions are used in the WHERE clause, or bind variable peeking does or does not take place, etc.
* If the statistics in SYS.AUX_STATS$ do not correctly reflect the performance of the system, the cost estimates could be incorrect.
* If OPTIMIZER_INDEX_COST_ADJ or OPTIMIZER_INDEX_CACHING are set incorrectly, the cost estimates could be incorrect.
* In some cases, if the DB_FILE_MULTIBLOCK_READ_COUNT is set incorrectly, the cost estimates could be incorrect.
* If a PARALLEL hint ( http://jonathanlewis.wordpress.com/2009/05/09/hints-on-hints/ ) is supplied, the calculated cost could be incorrect.
* If a CARDINALITY or OPT_ESTIMATE hint is used to change the expected number of rows returned by a result set, the calculated cost could be incorrect.
* If dynamic sampling is used, the calculated cost could be incorrect (Jonathan Lewis touches on this special case in the &quot;Expert Oracle Practices&quot; book).
* ... (I probably left out a lot of other possibilities - any other ideas?)

A decrease in the estimated cost probably means a decrease in the estimated execution time, and might mean a decrease in the actual execution time.  I am reminded of the following blog article:
http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/

Timur, good point.  By the way, I did not spent much time looking at the explain plans that are included in this blog article until you stated that the join order is exactly the same.  I then thought that the plans were &quot;interesting&quot; since they do appear to be different on first glance.]]></description>
		<content:encoded><![CDATA[<p>Anand, one of the questions that seems to be brought up in discussion forums somewhat frequently is: &#8220;the cost for this plan is too high, how can I lower the cost?&#8221;  It is important to keep in mind that the cost figure that appears in explain plans is just an estimate.<br />
* If the optimizer estimates incorrectly the number of rows that will be returned from a result set, the calculated cost will be incorrect.  This could happen if statistics have not been collected recently for tables and indexes, or if some of the columns are correlated (not truly independent), or if the wrong data type is selected for a column (or bind variable definition), or functions are used in the WHERE clause, or bind variable peeking does or does not take place, etc.<br />
* If the statistics in SYS.AUX_STATS$ do not correctly reflect the performance of the system, the cost estimates could be incorrect.<br />
* If OPTIMIZER_INDEX_COST_ADJ or OPTIMIZER_INDEX_CACHING are set incorrectly, the cost estimates could be incorrect.<br />
* In some cases, if the DB_FILE_MULTIBLOCK_READ_COUNT is set incorrectly, the cost estimates could be incorrect.<br />
* If a PARALLEL hint ( <a href="http://jonathanlewis.wordpress.com/2009/05/09/hints-on-hints/" rel="nofollow">http://jonathanlewis.wordpress.com/2009/05/09/hints-on-hints/</a> ) is supplied, the calculated cost could be incorrect.<br />
* If a CARDINALITY or OPT_ESTIMATE hint is used to change the expected number of rows returned by a result set, the calculated cost could be incorrect.<br />
* If dynamic sampling is used, the calculated cost could be incorrect (Jonathan Lewis touches on this special case in the &#8220;Expert Oracle Practices&#8221; book).<br />
* &#8230; (I probably left out a lot of other possibilities &#8211; any other ideas?)</p>
<p>A decrease in the estimated cost probably means a decrease in the estimated execution time, and might mean a decrease in the actual execution time.  I am reminded of the following blog article:<br />
<a href="http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/" rel="nofollow">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/</a></p>
<p>Timur, good point.  By the way, I did not spent much time looking at the explain plans that are included in this blog article until you stated that the join order is exactly the same.  I then thought that the plans were &#8220;interesting&#8221; since they do appear to be different on first glance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timur Akhmadeev</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-252</link>
		<dc:creator><![CDATA[Timur Akhmadeev]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 09:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-252</guid>
		<description><![CDATA[&gt;Additionally, one should not directly compare the calculated cost of one execution plan with that of a second execution plan
Well, on the other hand, one who understand what is the cost, what cost-based optimizer is  and what&#039;s behind CBO calculations, tend to carefully compare the figures reported by explain plan.]]></description>
		<content:encoded><![CDATA[<p>&gt;Additionally, one should not directly compare the calculated cost of one execution plan with that of a second execution plan<br />
Well, on the other hand, one who understand what is the cost, what cost-based optimizer is  and what&#8217;s behind CBO calculations, tend to carefully compare the figures reported by explain plan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anand</title>
		<link>http://hoopercharles.wordpress.com/2010/01/29/explain-plan-which-plan-is-better/#comment-251</link>
		<dc:creator><![CDATA[Anand]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 08:55:17 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1041#comment-251</guid>
		<description><![CDATA[Hi Charles,

&quot;test the performance to see which execution plan is more efficient, rather than guessing.&quot; Very true.

Does decrease in cost means decrease in elapsed time/execution time of the query?]]></description>
		<content:encoded><![CDATA[<p>Hi Charles,</p>
<p>&#8220;test the performance to see which execution plan is more efficient, rather than guessing.&#8221; Very true.</p>
<p>Does decrease in cost means decrease in elapsed time/execution time of the query?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
