<?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: Cost is Time</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 22 May 2013 12:40:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Cost Is Time: Next Generation &#171; Ukrainian Oracle User Group</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-41108</link>
		<dc:creator><![CDATA[Cost Is Time: Next Generation &#171; Ukrainian Oracle User Group]]></dc:creator>
		<pubDate>Thu, 28 Jul 2011 14:36:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-41108</guid>
		<description><![CDATA[[...] cost estimate generated by the Cost-Based Optimizer (CBO) has always been a time estimate, although expressed in a slightly obscure unit, which is number of single block [...]]]></description>
		<content:encoded><![CDATA[<p>[...] cost estimate generated by the Cost-Based Optimizer (CBO) has always been a time estimate, although expressed in a slightly obscure unit, which is number of single block [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cost &#8211; again &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-39124</link>
		<dc:creator><![CDATA[Cost &#8211; again &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Mon, 10 Jan 2011 18:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-39124</guid>
		<description><![CDATA[[...] on AskTom several years ago &#8211; but it&#8217;s wrong. As I&#8217;ve pointed out in the past, &#8220;Cost is Time&#8221;. The cost of a query represents the optimizer&#8217;s estimate of how long it will take that query [...]]]></description>
		<content:encoded><![CDATA[<p>[...] on AskTom several years ago &#8211; but it&#8217;s wrong. As I&#8217;ve pointed out in the past, &#8220;Cost is Time&#8221;. The cost of a query represents the optimizer&#8217;s estimate of how long it will take that query [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glossary &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-34391</link>
		<dc:creator><![CDATA[Glossary &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Fri, 11 Sep 2009 09:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-34391</guid>
		<description><![CDATA[[...] Cost: The &#8220;cost&#8221; column of an execution plan is the optimizer&#8217;s way of expressing the amount of time it will take to complete the query. Unfortunately there are defects and deficiencies in the optimizer&#8217;s cost model that mean the calculations may fail to produce a reasonable estimate. Because of this it is possible for two queries to have the same cost but hugely different execution times; similarly you can have a &#8220;low-cost&#8221; query that run for ages and a &#8220;high-cost&#8221; query that completes almost instantly. Note &#8211; also that the calculation and interpretation of &#8220;cost&#8221; are harder to deal with when the optimizer is using &#8220;&#8221;first_k_rows (fkr)&#8221; optimisation.  Technically, though &#8220;cost is time&#8221;. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Cost: The &#8220;cost&#8221; column of an execution plan is the optimizer&#8217;s way of expressing the amount of time it will take to complete the query. Unfortunately there are defects and deficiencies in the optimizer&#8217;s cost model that mean the calculations may fail to produce a reasonable estimate. Because of this it is possible for two queries to have the same cost but hugely different execution times; similarly you can have a &#8220;low-cost&#8221; query that run for ages and a &#8220;high-cost&#8221; query that completes almost instantly. Note &#8211; also that the calculation and interpretation of &#8220;cost&#8221; are harder to deal with when the optimizer is using &#8220;&#8221;first_k_rows (fkr)&#8221; optimisation.  Technically, though &#8220;cost is time&#8221;. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Resc/Resp &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-2819</link>
		<dc:creator><![CDATA[Resc/Resp &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Sun, 28 Jan 2007 23:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-2819</guid>
		<description><![CDATA[[...] But when you run parallel, you calculate the resource requirement for the query then share the resource load across the parallel execution slaves. Assuming the slaves don&#8217;t interfere with each other the resources handled by each of N slaves will, in the simplest cases, be 1/N&#8217;th of the total resource requirement - which means the response time should be 1/N&#8217;th of the serial response time. Hence for parallel execution, you need to show the cost implied by the resource requirement (Resc) and the cost implied by the response time (Resp) of a single slave as it handles its shared of the resources.  (Remember: cost is time). [...]]]></description>
		<content:encoded><![CDATA[<p>[...] But when you run parallel, you calculate the resource requirement for the query then share the resource load across the parallel execution slaves. Assuming the slaves don&#8217;t interfere with each other the resources handled by each of N slaves will, in the simplest cases, be 1/N&#8217;th of the total resource requirement &#8211; which means the response time should be 1/N&#8217;th of the serial response time. Hence for parallel execution, you need to show the cost implied by the resource requirement (Resc) and the cost implied by the response time (Resp) of a single slave as it handles its shared of the resources.  (Remember: cost is time). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-427</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 12 Dec 2006 19:34:24 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-427</guid>
		<description><![CDATA[Tonguc,  the answer is in rounding errors. Oracle got as close as it could because it&#039;s reporting to the second - and it&#039;s rounding up, rather than rounding to the nearest second.]]></description>
		<content:encoded><![CDATA[<p>Tonguc,  the answer is in rounding errors. Oracle got as close as it could because it&#8217;s reporting to the second &#8211; and it&#8217;s rounding up, rather than rounding to the nearest second.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tonguç</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-425</link>
		<dc:creator><![CDATA[Tonguç]]></dc:creator>
		<pubDate>Tue, 12 Dec 2006 10:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-425</guid>
		<description><![CDATA[I was working on your article but I couldn&#039;t match the time value from the cost as you mentioned, I hope you find time to help me sir, thank you.

Here is the example on Oracle XE;

SELECT pname, pval1 FROM sys.aux_stats$ WHERE sname = &#039;SYSSTATS_MAIN&#039;;

PNAME                               PVAL1
------------------------------ ----------
CPUSPEED                              515
CPUSPEEDNW                        506,097
IOSEEKTIM                          12,242
IOTFRSPEED                      21258,578
MAXTHR                            6489088
MBRC                                   78
MREADTIM                           34,979
SLAVETHR
SREADTIM                            &lt;b&gt;7,798&lt;/b&gt;

9 rows selected.

execute dbms_random.seed(0)
drop table t1 purge;      
create table t1 as select
	rownum				id,
	trunc(dbms_random.value(1,50))	n1,
	rpad(&#039;x&#039;,100)			padding
from	all_objects where	rownum  user,
		tabname		 =&gt;&#039;T1&#039;,
		cascade		 =&gt; true,
		estimate_percent =&gt; null,
		granularity      =&gt; &#039;default&#039;,
		method_opt 	 =&gt; &#039;for all columns size 1&#039;	);
end;
/     
variable m_n1	number
execute :m_n1 := 10;      
explain plan set statement_id &#039;xyz&#039; for
select n1, padding from t1 where id = :m_n1;
select * from table(dbms_xplan.display(&#039;plan_table&#039;,&#039;xyz&#039;));
..
&#124; Id  &#124; Operation                   &#124; Name     &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
..
&#124;   0 &#124; SELECT STATEMENT            &#124;          &#124;     1 &#124;   107 &#124;     &lt;b&gt;2&lt;/b&gt;   (0)&#124; &lt;b&gt;00:00:01&lt;/b&gt; &#124;
..
HR on 12/12/2006 at XE &gt; select round(2 * 7.798 / 1000, 3)      time from dual ;


      TIME
----------
      &lt;b&gt;,016&lt;/b&gt;

Kind regards,
Tonguç]]></description>
		<content:encoded><![CDATA[<p>I was working on your article but I couldn&#8217;t match the time value from the cost as you mentioned, I hope you find time to help me sir, thank you.</p>
<p>Here is the example on Oracle XE;</p>
<p>SELECT pname, pval1 FROM sys.aux_stats$ WHERE sname = &#8216;SYSSTATS_MAIN&#8217;;</p>
<p>PNAME                               PVAL1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;-<br />
CPUSPEED                              515<br />
CPUSPEEDNW                        506,097<br />
IOSEEKTIM                          12,242<br />
IOTFRSPEED                      21258,578<br />
MAXTHR                            6489088<br />
MBRC                                   78<br />
MREADTIM                           34,979<br />
SLAVETHR<br />
SREADTIM                            <b>7,798</b></p>
<p>9 rows selected.</p>
<p>execute dbms_random.seed(0)<br />
drop table t1 purge;<br />
create table t1 as select<br />
	rownum				id,<br />
	trunc(dbms_random.value(1,50))	n1,<br />
	rpad(&#8216;x&#8217;,100)			padding<br />
from	all_objects where	rownum  user,<br />
		tabname		 =&gt;&#8217;T1&#8242;,<br />
		cascade		 =&gt; true,<br />
		estimate_percent =&gt; null,<br />
		granularity      =&gt; &#8216;default&#8217;,<br />
		method_opt 	 =&gt; &#8216;for all columns size 1&#8242;	);<br />
end;<br />
/<br />
variable m_n1	number<br />
execute :m_n1 := 10;<br />
explain plan set statement_id &#8216;xyz&#8217; for<br />
select n1, padding from t1 where id = :m_n1;<br />
select * from table(dbms_xplan.display(&#8216;plan_table&#8217;,'xyz&#8217;));<br />
..<br />
| Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |<br />
..<br />
|   0 | SELECT STATEMENT            |          |     1 |   107 |     <b>2</b>   (0)| <b>00:00:01</b> |<br />
..<br />
HR on 12/12/2006 at XE &gt; select round(2 * 7.798 / 1000, 3)      time from dual ;</p>
<p>      TIME<br />
&#8212;&#8212;&#8212;-<br />
      <b>,016</b></p>
<p>Kind regards,<br />
Tonguç</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-421</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 12 Dec 2006 07:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-421</guid>
		<description><![CDATA[Doug,  In many cases, cost is not &quot;very reliable&quot; as an indicator; but if you (a) know what it means, (b) know what makes the optimizer go wrong, and (c) don&#039;t mess too much with poorly understood parameters - then it makes sense to take note of what it is telling you.]]></description>
		<content:encoded><![CDATA[<p>Doug,  In many cases, cost is not &#8220;very reliable&#8221; as an indicator; but if you (a) know what it means, (b) know what makes the optimizer go wrong, and (c) don&#8217;t mess too much with poorly understood parameters &#8211; then it makes sense to take note of what it is telling you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug C</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-420</link>
		<dc:creator><![CDATA[Doug C]]></dc:creator>
		<pubDate>Tue, 12 Dec 2006 05:40:20 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/11/cost-is-time/#comment-420</guid>
		<description><![CDATA[Hey - is this column useful? Tom Kyte pretty much says if you are using cost to tune different queries, you&#039;re barking up the wrong tree.  Cost is not reliable.  You agree? Maybe to a different extent?]]></description>
		<content:encoded><![CDATA[<p>Hey &#8211; is this column useful? Tom Kyte pretty much says if you are using cost to tune different queries, you&#8217;re barking up the wrong tree.  Cost is not reliable.  You agree? Maybe to a different extent?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
