<?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: How long &#8230;</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2006/11/17/how-long/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Tue, 18 Jun 2013 17:11:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Rob</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-276</link>
		<dc:creator><![CDATA[Rob]]></dc:creator>
		<pubDate>Mon, 27 Nov 2006 16:23:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-276</guid>
		<description><![CDATA[Playing with connect by, once I ran this (on a test system)

   select * from (select level l from dual connect by level &gt; 1) order by l desc

forever !]]></description>
		<content:encoded><![CDATA[<p>Playing with connect by, once I ran this (on a test system)</p>
<p>   select * from (select level l from dual connect by level &gt; 1) order by l desc</p>
<p>forever !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cosmin</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-220</link>
		<dc:creator><![CDATA[cosmin]]></dc:creator>
		<pubDate>Tue, 21 Nov 2006 18:29:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-220</guid>
		<description><![CDATA[funny,
I came across the very same thought, working on a problem just the other day re:  how much time and how much space is required for a large DW job....  doing some FTS on some pretty large tables, it required some 60+ gb of temp space and a few good hours of processing time.  Have a bit of a (different) appreciation now for these (large) jobs...  ;-)]]></description>
		<content:encoded><![CDATA[<p>funny,<br />
I came across the very same thought, working on a problem just the other day re:  how much time and how much space is required for a large DW job&#8230;.  doing some FTS on some pretty large tables, it required some 60+ gb of temp space and a few good hours of processing time.  Have a bit of a (different) appreciation now for these (large) jobs&#8230;  ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dilipkumar Patel</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-201</link>
		<dc:creator><![CDATA[Dilipkumar Patel]]></dc:creator>
		<pubDate>Mon, 20 Nov 2006 16:58:24 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-201</guid>
		<description><![CDATA[In case of partitioned table, it&#039;s great risk if partition statistics is missing for some of the partitions, I observed plan gets changed very drastically and so the execution time. Use of DOP (Degree of Parallelism) also key factor.]]></description>
		<content:encoded><![CDATA[<p>In case of partitioned table, it&#8217;s great risk if partition statistics is missing for some of the partitions, I observed plan gets changed very drastically and so the execution time. Use of DOP (Degree of Parallelism) also key factor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudhi</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-198</link>
		<dc:creator><![CDATA[Sudhi]]></dc:creator>
		<pubDate>Mon, 20 Nov 2006 04:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-198</guid>
		<description><![CDATA[Jaffar &amp; Jonathan, Yes I&#039;m aware of the traps of explain plan and the various things that come with it. I just use it as a starting *estimate* combined with application requirements of the query. Of course the entire thing is NOT trusted at its face value, but gives a very good starting point to think about the plan &amp; elapsed time. This has also helped the developers to change their approach from &quot;tune this query&quot; to &quot;does this makes sense&quot; or &quot;Can I come out with a better query&quot; :)]]></description>
		<content:encoded><![CDATA[<p>Jaffar &amp; Jonathan, Yes I&#8217;m aware of the traps of explain plan and the various things that come with it. I just use it as a starting *estimate* combined with application requirements of the query. Of course the entire thing is NOT trusted at its face value, but gives a very good starting point to think about the plan &amp; elapsed time. This has also helped the developers to change their approach from &#8220;tune this query&#8221; to &#8220;does this makes sense&#8221; or &#8220;Can I come out with a better query&#8221; :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-195</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 19 Nov 2006 18:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-195</guid>
		<description><![CDATA[Ken, I think that you&#039;re quoting the guideline Cary gives when reviewing the summary of work done by SQL after the event.  The figure 10 is probably allowing for a &quot;reasonably precise&quot; application. In similar circumstatnces I tend to take 4 LIOs as a guideline on &quot;perfect precision&quot; - based on a very simple-minded approximation that a single row goes through &quot;root, branch, leaf, table&quot;.
Kyle, it&#039;s interesting to note that your first paragraph says you don&#039;t know how to set a target, and then your second paragraph gives a perfect description of how to set a target. The &quot;reasonable expectation&quot; based on complexity of query, data to be analysed is IT. Your comments, combined with Alberto&#039;s, plus a little formalism is all it needs to figure out rough, but adequate, targets.
I&#039;ll be writing something up about it eventually - but a pretty good starting point is:
	
&lt;em&gt;Work out a &quot;business-aware&quot; execution path, and walk it, counting the accumulation of data, and block visits for filtering subqueries. The data volume (row counts) depend on knowing the business, and the block visits (derived from row counts) then needs an understanding of the likely data scatter.&lt;/em&gt;

Basically I take the same approach as Alberto, with the assumeption that index blocks will be buffered and table blocks will be phsyical I/Os and that time will be mostly about physical I/O.
It&#039;s not a great approximation, but it does two things - it highlights the cases where the query is likely to thrash the I/O subsystem (and will probably start using merge or hash joins), and it gives me an idea of whether I need to review the query, the business requirement, or the database structure.
Sudhi, as Jaffar points out you need to be a bit careful about trusting the execution plans from &lt;strong&gt;explain plan&lt;/strong&gt;.  (See Volume 2 of my book when I manage to finish it). But if you&#039;ve allowed for all the traps, the execution can be helpful on two counts: you can use it to decide if Oracle&#039;s chosen plan makes sense from a business perspective, and you can follow Alberto&#039;s strategy by mentally executing the chosen plan to see if the work predicted by the optimizer matches your mental image of the data.
]]></description>
		<content:encoded><![CDATA[<p>Ken, I think that you&#8217;re quoting the guideline Cary gives when reviewing the summary of work done by SQL after the event.  The figure 10 is probably allowing for a &#8220;reasonably precise&#8221; application. In similar circumstatnces I tend to take 4 LIOs as a guideline on &#8220;perfect precision&#8221; &#8211; based on a very simple-minded approximation that a single row goes through &#8220;root, branch, leaf, table&#8221;.<br />
Kyle, it&#8217;s interesting to note that your first paragraph says you don&#8217;t know how to set a target, and then your second paragraph gives a perfect description of how to set a target. The &#8220;reasonable expectation&#8221; based on complexity of query, data to be analysed is IT. Your comments, combined with Alberto&#8217;s, plus a little formalism is all it needs to figure out rough, but adequate, targets.<br />
I&#8217;ll be writing something up about it eventually &#8211; but a pretty good starting point is:</p>
<p><em>Work out a &#8220;business-aware&#8221; execution path, and walk it, counting the accumulation of data, and block visits for filtering subqueries. The data volume (row counts) depend on knowing the business, and the block visits (derived from row counts) then needs an understanding of the likely data scatter.</em></p>
<p>Basically I take the same approach as Alberto, with the assumeption that index blocks will be buffered and table blocks will be phsyical I/Os and that time will be mostly about physical I/O.<br />
It&#8217;s not a great approximation, but it does two things &#8211; it highlights the cases where the query is likely to thrash the I/O subsystem (and will probably start using merge or hash joins), and it gives me an idea of whether I need to review the query, the business requirement, or the database structure.<br />
Sudhi, as Jaffar points out you need to be a bit careful about trusting the execution plans from <strong>explain plan</strong>.  (See Volume 2 of my book when I manage to finish it). But if you&#8217;ve allowed for all the traps, the execution can be helpful on two counts: you can use it to decide if Oracle&#8217;s chosen plan makes sense from a business perspective, and you can follow Alberto&#8217;s strategy by mentally executing the chosen plan to see if the work predicted by the optimizer matches your mental image of the data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaffar</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-194</link>
		<dc:creator><![CDATA[Jaffar]]></dc:creator>
		<pubDate>Sun, 19 Nov 2006 14:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-194</guid>
		<description><![CDATA[Sudhi,

&gt;&gt;I just do a quick explain plan of the query in question on a test/dev/production machine and that gives a good estimate to start with.

There won&#039;t be any guarantee that the explain for the query would be the sam when you run on test/dev/production. Also, depends which way you get the explain plan, using different methods to get explain plan for the query.]]></description>
		<content:encoded><![CDATA[<p>Sudhi,</p>
<p>&gt;&gt;I just do a quick explain plan of the query in question on a test/dev/production machine and that gives a good estimate to start with.</p>
<p>There won&#8217;t be any guarantee that the explain for the query would be the sam when you run on test/dev/production. Also, depends which way you get the explain plan, using different methods to get explain plan for the query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudhi</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-193</link>
		<dc:creator><![CDATA[Sudhi]]></dc:creator>
		<pubDate>Sun, 19 Nov 2006 13:46:33 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-193</guid>
		<description><![CDATA[Most of the times, I just do a quick explain plan of the query in question on a test/dev/production machine and that gives a good estimate to start with. Of course the query will go through the actual run and times calculated, but the explain plan should be a decent start..no?]]></description>
		<content:encoded><![CDATA[<p>Most of the times, I just do a quick explain plan of the query in question on a test/dev/production machine and that gives a good estimate to start with. Of course the query will go through the actual run and times calculated, but the explain plan should be a decent start..no?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Dell'Era</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-185</link>
		<dc:creator><![CDATA[Alberto Dell'Era]]></dc:creator>
		<pubDate>Fri, 17 Nov 2006 22:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-185</guid>
		<description><![CDATA[I normally assume that a single-block PIO takes about 10msec, and a LIO 1/tenth of that (1msec), then I mentally execute the query in the steady system state (assuming eg that the root block of an index is always cached, so it gets counted as LIO, etc).

I also assume that a multiblock I/O takes the same time as two-three single-block accesses.

The best access path/join order I can imagine becomes my tuning target.

I resort to measuring, rather than assuming, the cpu used for hash joins and sorting operations, since I&#039;ve yet to found a reasonable heuristic for them; the same, a fortiori, for latches acquisitions (whose impact, sadly, can normally be measured only in production, under the real load).

But my tuning process is, mostly, by intuition, guided by some guidelines such as the ones presented above, and some simplified experiments on (possible synthetic) data for the most critical statements.]]></description>
		<content:encoded><![CDATA[<p>I normally assume that a single-block PIO takes about 10msec, and a LIO 1/tenth of that (1msec), then I mentally execute the query in the steady system state (assuming eg that the root block of an index is always cached, so it gets counted as LIO, etc).</p>
<p>I also assume that a multiblock I/O takes the same time as two-three single-block accesses.</p>
<p>The best access path/join order I can imagine becomes my tuning target.</p>
<p>I resort to measuring, rather than assuming, the cpu used for hash joins and sorting operations, since I&#8217;ve yet to found a reasonable heuristic for them; the same, a fortiori, for latches acquisitions (whose impact, sadly, can normally be measured only in production, under the real load).</p>
<p>But my tuning process is, mostly, by intuition, guided by some guidelines such as the ones presented above, and some simplified experiments on (possible synthetic) data for the most critical statements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-184</link>
		<dc:creator><![CDATA[Ken]]></dc:creator>
		<pubDate>Fri, 17 Nov 2006 20:07:46 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-184</guid>
		<description><![CDATA[A suggestion I once heard from Mr. Millsap applicable for non-aggregating query was

10 LIO per returned row per tables in the From clause
e.g. 2 rows returned from a 3 table join LIO should be no greater than 60

I&#039;ve found this to be generally applicable.

Otherwise it depends on end user satisfaction and  impact on the system 

Ken]]></description>
		<content:encoded><![CDATA[<p>A suggestion I once heard from Mr. Millsap applicable for non-aggregating query was</p>
<p>10 LIO per returned row per tables in the From clause<br />
e.g. 2 rows returned from a 3 table join LIO should be no greater than 60</p>
<p>I&#8217;ve found this to be generally applicable.</p>
<p>Otherwise it depends on end user satisfaction and  impact on the system </p>
<p>Ken</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-182</link>
		<dc:creator><![CDATA[Kyle]]></dc:creator>
		<pubDate>Fri, 17 Nov 2006 17:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/11/17/how-long/#comment-182</guid>
		<description><![CDATA[but I wonder how many people actually formulate the question, and then do a scratch calculation to get an answer. 

I don&#039;t, because I don&#039;t know how to, but I am willing to learn.  Any pointers / reference documents / examples?

And if you don’t do it, how do you know what your tuning target is ?

By a reasonable expectation, based on the complexity of the query, volume of data that will be analyzed, etc.  I work to tune the query for the lowest LIOs, but, as I already stated, do not really know how to calculate a target.]]></description>
		<content:encoded><![CDATA[<p>but I wonder how many people actually formulate the question, and then do a scratch calculation to get an answer. </p>
<p>I don&#8217;t, because I don&#8217;t know how to, but I am willing to learn.  Any pointers / reference documents / examples?</p>
<p>And if you don’t do it, how do you know what your tuning target is ?</p>
<p>By a reasonable expectation, based on the complexity of the query, volume of data that will be analyzed, etc.  I work to tune the query for the lowest LIOs, but, as I already stated, do not really know how to calculate a target.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
