<?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: First_rows hash</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Fri, 24 May 2013 13:27:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45821</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 06:31:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45821</guid>
		<description><![CDATA[Xenofon,

&quot;CPU Costing&quot; and &quot;System statistics&quot; are synonyms for the same mechanism. Because of the version-dependency in the rules for using system statistics, I call dbms_stats.delete_system_stats and set _optimizer_cost_model to &quot;io&quot; to ensure that I&#039;ve disabled system statistics.

As far as repeatable results go - the use of system statistics will change the cost of a tablescan relative to an index access path in ways that are dependent on the actual numbers in the sys.aux_stats$ table, getting rid of them will ensure that people don&#039;t see different plans because they have different stats.

There are cases though (distributed queries come to mind) where certain features cannot appear unless system statistics are enabled, so sometimes I will explicitly set some values for the stats using dbms_stats.set_system_stats().]]></description>
		<content:encoded><![CDATA[<p>Xenofon,</p>
<p>&#8220;CPU Costing&#8221; and &#8220;System statistics&#8221; are synonyms for the same mechanism. Because of the version-dependency in the rules for using system statistics, I call dbms_stats.delete_system_stats and set _optimizer_cost_model to &#8220;io&#8221; to ensure that I&#8217;ve disabled system statistics.</p>
<p>As far as repeatable results go &#8211; the use of system statistics will change the cost of a tablescan relative to an index access path in ways that are dependent on the actual numbers in the sys.aux_stats$ table, getting rid of them will ensure that people don&#8217;t see different plans because they have different stats.</p>
<p>There are cases though (distributed queries come to mind) where certain features cannot appear unless system statistics are enabled, so sometimes I will explicitly set some values for the stats using dbms_stats.set_system_stats().</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45820</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 06:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45820</guid>
		<description><![CDATA[Jeff,

Despite appearing in recent code released by Oracle Corp. the old first_rows hint was originally labelled in 9i as &quot;available only for backwards compatibility&quot;. As Pavol indicated, some of its paths (or avoidance of pathcs) were dictated by simple rules - so it&#039;s fairly easy to find cases where first_rows and first_rows(n) - even with n = 1 - differ dramatically in their outcome.]]></description>
		<content:encoded><![CDATA[<p>Jeff,</p>
<p>Despite appearing in recent code released by Oracle Corp. the old first_rows hint was originally labelled in 9i as &#8220;available only for backwards compatibility&#8221;. As Pavol indicated, some of its paths (or avoidance of pathcs) were dictated by simple rules &#8211; so it&#8217;s fairly easy to find cases where first_rows and first_rows(n) &#8211; even with n = 1 &#8211; differ dramatically in their outcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45819</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 06:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45819</guid>
		<description><![CDATA[Jeff&#039;s example was messed up by the way that Wordpress reads the &gt; and &lt; symbols as markers for html directives. I think a number of lines of the various inline views were deleted - leaving the oddity of a statement ending with &quot;rownum = :1&quot;.]]></description>
		<content:encoded><![CDATA[<p>Jeff&#8217;s example was messed up by the way that WordPress reads the &gt; and &lt; symbols as markers for html directives. I think a number of lines of the various inline views were deleted &#8211; leaving the oddity of a statement ending with &#8220;rownum = :1&#8243;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pavol Babel</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45777</link>
		<dc:creator><![CDATA[Pavol Babel]]></dc:creator>
		<pubDate>Thu, 29 Mar 2012 16:23:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45777</guid>
		<description><![CDATA[There are huge differences between FIRST_ROWS(N) algorithm  and old fashioned FIRST_ROWS. FIRST_ROWS tries to bypass physical sort always when possible. It could result into unexpected index use.

Regards

Pavol Babel]]></description>
		<content:encoded><![CDATA[<p>There are huge differences between FIRST_ROWS(N) algorithm  and old fashioned FIRST_ROWS. FIRST_ROWS tries to bypass physical sort always when possible. It could result into unexpected index use.</p>
<p>Regards</p>
<p>Pavol Babel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Log Buffer #263, A Carnival of the Vanities for DBAs &#124; The Pythian Blog</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45538</link>
		<dc:creator><![CDATA[Log Buffer #263, A Carnival of the Vanities for DBAs &#124; The Pythian Blog]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 06:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45538</guid>
		<description><![CDATA[[...] posting by Jonathan Lewis is about a problem as well as being about a hash [...]]]></description>
		<content:encoded><![CDATA[<p>[...] posting by Jonathan Lewis is about a problem as well as being about a hash [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Jacobs, Oracle Ace</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45526</link>
		<dc:creator><![CDATA[Jeff Jacobs, Oracle Ace]]></dc:creator>
		<pubDate>Thu, 15 Mar 2012 16:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45526</guid>
		<description><![CDATA[The test case is the query in my original comment against the standard SH demo schema.   Note that this &quot;bug&quot; appears to be only for FIRST_ROWS, without the number of rows being specified, either via FIRST_ROWS_n, or FIRST_ROWS (n).  The latter generate appropriate execution plans.   Also, &quot;FIRST_ROWS&quot; by itself is apparently deprecated in 11GR2.]]></description>
		<content:encoded><![CDATA[<p>The test case is the query in my original comment against the standard SH demo schema.   Note that this &#8220;bug&#8221; appears to be only for FIRST_ROWS, without the number of rows being specified, either via FIRST_ROWS_n, or FIRST_ROWS (n).  The latter generate appropriate execution plans.   Also, &#8220;FIRST_ROWS&#8221; by itself is apparently deprecated in 11GR2.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Joseph</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45524</link>
		<dc:creator><![CDATA[George Joseph]]></dc:creator>
		<pubDate>Thu, 15 Mar 2012 13:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45524</guid>
		<description><![CDATA[Hi Jeff
[sourcecode]
SELECT *
FROM (SELECT /*+ FIRST_ROWS */
ROWNUM AS rnum, cust_last_name
FROM ( SELECT cust_last_name
FROM customers
WHERE CUST_LAST_NAME BETWEEN ‘A%’ AND ‘D%’
ORDER BY cust_last_name) a
WHERE ROWNUM = :1; — set to 10000
[/sourcecode]
Could you please provide the full test case for the explain plan that has got you the problem with first_rows hint.?]]></description>
		<content:encoded><![CDATA[<p>Hi Jeff</p>
<pre class="brush: plain; title: ; notranslate">
SELECT *
FROM (SELECT /*+ FIRST_ROWS */
ROWNUM AS rnum, cust_last_name
FROM ( SELECT cust_last_name
FROM customers
WHERE CUST_LAST_NAME BETWEEN ‘A%’ AND ‘D%’
ORDER BY cust_last_name) a
WHERE ROWNUM = :1; — set to 10000
</pre>
<p>Could you please provide the full test case for the explain plan that has got you the problem with first_rows hint.?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Jacobs, Oracle Ace</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45484</link>
		<dc:creator><![CDATA[Jeff Jacobs, Oracle Ace]]></dc:creator>
		<pubDate>Tue, 13 Mar 2012 18:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45484</guid>
		<description><![CDATA[A little more experimentation shows that the problem I describe is apparenly only for FIRST_ROWS hint, without a number qualifier, i.e. the &quot;_N&quot; (or the older &quot;(N)&quot;) when hinting a query.]]></description>
		<content:encoded><![CDATA[<p>A little more experimentation shows that the problem I describe is apparenly only for FIRST_ROWS hint, without a number qualifier, i.e. the &#8220;_N&#8221; (or the older &#8220;(N)&#8221;) when hinting a query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xenofon Grigoriadis</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45482</link>
		<dc:creator><![CDATA[Xenofon Grigoriadis]]></dc:creator>
		<pubDate>Tue, 13 Mar 2012 11:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45482</guid>
		<description><![CDATA[Why do you always disable (you mean delete?) system statistics in your tests? We all want to have repeatable behaviour in our tests, why does this help? In your book about the cost optimizer you disabled &quot;system statistics (CPU costing)&quot;. CPU costing? How is CPU costing related to this?]]></description>
		<content:encoded><![CDATA[<p>Why do you always disable (you mean delete?) system statistics in your tests? We all want to have repeatable behaviour in our tests, why does this help? In your book about the cost optimizer you disabled &#8220;system statistics (CPU costing)&#8221;. CPU costing? How is CPU costing related to this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Jacobs, Oracle Ace</title>
		<link>http://jonathanlewis.wordpress.com/2012/03/12/first_rows-hash/#comment-45456</link>
		<dc:creator><![CDATA[Jeff Jacobs, Oracle Ace]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 15:16:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8655#comment-45456</guid>
		<description><![CDATA[My example was from R12.01.]]></description>
		<content:encoded><![CDATA[<p>My example was from R12.01.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
