<?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: Manual Optimisation</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Mon, 20 May 2013 01:44:54 +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/2008/04/27/manual-optimisation/#comment-35456</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 10 Feb 2010 22:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-35456</guid>
		<description><![CDATA[RyanH
I&#039;ve supplied &lt;a href=&quot;http://forums.oracle.com/forums/message.jspa?messageID=4090690#4090690&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;an initial response &lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;to your thread. It&#039;s not a complete answer, and there were three different issues to think about in your original post anyway.]]></description>
		<content:encoded><![CDATA[<p>RyanH<br />
I&#8217;ve supplied <a href="http://forums.oracle.com/forums/message.jspa?messageID=4090690#4090690" rel="nofollow"><em><strong>an initial response </strong></em></a>to your thread. It&#8217;s not a complete answer, and there were three different issues to think about in your original post anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RyanH</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-35443</link>
		<dc:creator><![CDATA[RyanH]]></dc:creator>
		<pubDate>Tue, 09 Feb 2010 15:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-35443</guid>
		<description><![CDATA[Jonathan, any chance you can help me figure out how to refactor my (relatively simple) query to apply your methodologies?  I posted on the Oracle forums here: http://forums.oracle.com/forums/message.jspa?messageID=4083852.  It&#039;s a pagination query that I think could be extremely fast (even in a very large table) if I could get this to work...  I gave your hints a shot, but still get the same results, although its probably attributed to my lack of experience using these hints properly.  Thanks!]]></description>
		<content:encoded><![CDATA[<p>Jonathan, any chance you can help me figure out how to refactor my (relatively simple) query to apply your methodologies?  I posted on the Oracle forums here: <a href="http://forums.oracle.com/forums/message.jspa?messageID=4083852" rel="nofollow">http://forums.oracle.com/forums/message.jspa?messageID=4083852</a>.  It&#8217;s a pagination query that I think could be extremely fast (even in a very large table) if I could get this to work&#8230;  I gave your hints a shot, but still get the same results, although its probably attributed to my lack of experience using these hints properly.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manual Optimisation 3 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-32452</link>
		<dc:creator><![CDATA[Manual Optimisation 3 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Tue, 23 Dec 2008 20:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-32452</guid>
		<description><![CDATA[[...] little series started from a note I wrote about manual optimisation where I took advantage of a sort operation in a non-mergeable view to produce sorted data from a [...]]]></description>
		<content:encoded><![CDATA[<p>[...] little series started from a note I wrote about manual optimisation where I took advantage of a sort operation in a non-mergeable view to produce sorted data from a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kerry</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-31748</link>
		<dc:creator><![CDATA[kerry]]></dc:creator>
		<pubDate>Tue, 02 Sep 2008 15:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-31748</guid>
		<description><![CDATA[I have a similar optimization issue involving many 100,000s of already time-ordered rows. In my situation, the rows are not stored in the database at all, but are returned from a pipelined table function reading from a socket. I&#039;d like to be able to use analytics on the data, but without imposing an unnecessary window sort (and without storing the data in a table first). I am searching for something like a keyword or pragma that would declare the pipelined table function&#039;s implicit ordering so the optimizer could make use of it.  I would settle for something like the hints you use in the article here.  Ideally, oracle would let me declare the order of the data returned from the table function, and then just enforce the ordering with an exception similar to doing a CREATE INDEX ... NOSORT ... where the sort step is replaced with a validation.

Any ideas?]]></description>
		<content:encoded><![CDATA[<p>I have a similar optimization issue involving many 100,000s of already time-ordered rows. In my situation, the rows are not stored in the database at all, but are returned from a pipelined table function reading from a socket. I&#8217;d like to be able to use analytics on the data, but without imposing an unnecessary window sort (and without storing the data in a table first). I am searching for something like a keyword or pragma that would declare the pipelined table function&#8217;s implicit ordering so the optimizer could make use of it.  I would settle for something like the hints you use in the article here.  Ideally, oracle would let me declare the order of the data returned from the table function, and then just enforce the ordering with an exception similar to doing a CREATE INDEX &#8230; NOSORT &#8230; where the sort step is replaced with a validation.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sorted Hash Clusters &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-31516</link>
		<dc:creator><![CDATA[Sorted Hash Clusters &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Sun, 13 Jul 2008 21:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-31516</guid>
		<description><![CDATA[[...] Jonathan Lewis @ 9:25 pm UTC Jul 13,2008   Towards the end of April, I published a note about manual optimisation,  and mentioned in one of the comments (#19) that as part of the discussion of the (slightly [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Jonathan Lewis @ 9:25 pm UTC Jul 13,2008   Towards the end of April, I published a note about manual optimisation,  and mentioned in one of the comments (#19) that as part of the discussion of the (slightly [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manual Optimisation - 2 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-30986</link>
		<dc:creator><![CDATA[Manual Optimisation - 2 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Fri, 09 May 2008 13:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-30986</guid>
		<description><![CDATA[[...] Manual Optimisation -&#160;2 Filed under: Performance, Tuning &#8212; Jonathan Lewis @ 1:13 pm UTC May 9,2008   Back to Manual Optimisation part 1 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Manual Optimisation -&nbsp;2 Filed under: Performance, Tuning &#8212; Jonathan Lewis @ 1:13 pm UTC May 9,2008   Back to Manual Optimisation part 1 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-30985</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 09 May 2008 07:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-30985</guid>
		<description><![CDATA[Krish,

Thanks for the information.

The suggestion about stored outlines was Greg&#039;s idea for trying to bypass the issue of hints being disabled by a parameter change - so isn&#039;t really relevant to the original query.

SPM, on the other hand, might have some interesting effects on hinted SQL (although in theory the effects should only be beneficial).

Because of SPM, the optimizer may re-optimize a query whose performance seems to be bad because of variations in bound values. Most people who put hints into SQL don&#039;t do it properly, get a bit lucky, and happen to get the plan they want to see. But if SPM tries to find different plans from time to time, then I &lt;i&gt;&lt;b&gt;guess&lt;/b&gt;&lt;/i&gt; there will be an increased chance of the optimizer using unexpected plans on hinted code - while still obeying all the hints that have been supplied.

It&#039;s an idea I&#039;ll have to play aruond with at some point - but not just yet.]]></description>
		<content:encoded><![CDATA[<p>Krish,</p>
<p>Thanks for the information.</p>
<p>The suggestion about stored outlines was Greg&#8217;s idea for trying to bypass the issue of hints being disabled by a parameter change &#8211; so isn&#8217;t really relevant to the original query.</p>
<p>SPM, on the other hand, might have some interesting effects on hinted SQL (although in theory the effects should only be beneficial).</p>
<p>Because of SPM, the optimizer may re-optimize a query whose performance seems to be bad because of variations in bound values. Most people who put hints into SQL don&#8217;t do it properly, get a bit lucky, and happen to get the plan they want to see. But if SPM tries to find different plans from time to time, then I <i><b>guess</b></i> there will be an increased chance of the optimizer using unexpected plans on hinted code &#8211; while still obeying all the hints that have been supplied.</p>
<p>It&#8217;s an idea I&#8217;ll have to play aruond with at some point &#8211; but not just yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krish</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-30984</link>
		<dc:creator><![CDATA[krish]]></dc:creator>
		<pubDate>Fri, 09 May 2008 06:13:33 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-30984</guid>
		<description><![CDATA[The current system or session setting of use_stored_outlines can be seen by oradebug (oradebug dumpvar sga sgauso or oradebug dumpvar uga ugauso)

It is given in the metalink note 613682.992.

BTW with stored outlines being deprecated in 11g, how does SQL Plan management fit in all this.]]></description>
		<content:encoded><![CDATA[<p>The current system or session setting of use_stored_outlines can be seen by oradebug (oradebug dumpvar sga sgauso or oradebug dumpvar uga ugauso)</p>
<p>It is given in the metalink note 613682.992.</p>
<p>BTW with stored outlines being deprecated in 11g, how does SQL Plan management fit in all this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-30981</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 08 May 2008 07:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-30981</guid>
		<description><![CDATA[Greg,

A quick check shows that stored outlines (and profiles) still work in 10g even when hints have been disabled.

However, there are two problems with your suggestion. First, I don&#039;t know how to find out the current setting of my session&#039;s value for &quot;use_stored_outlines&quot;, and that needs to be set to the correct category to make the outline apply.  I don&#039;t think it&#039;s even in the structure under &lt;b&gt;&lt;i&gt;v$ses_optimizer_env&lt;/b&gt;&lt;/i&gt;.


Secondly I think Tom&#039;s point is the more generic one that the current set of hints (even when converted to a stored outline) may not be sufficient to make the plan appear after a future upgrade.  This argument, by the way, is one that I use about any hinting anyway, so doesn&#039;t really worry me in terms of being a &quot;new&quot; risk introduced by this code sample.]]></description>
		<content:encoded><![CDATA[<p>Greg,</p>
<p>A quick check shows that stored outlines (and profiles) still work in 10g even when hints have been disabled.</p>
<p>However, there are two problems with your suggestion. First, I don&#8217;t know how to find out the current setting of my session&#8217;s value for &#8220;use_stored_outlines&#8221;, and that needs to be set to the correct category to make the outline apply.  I don&#8217;t think it&#8217;s even in the structure under <b><i>v$ses_optimizer_env</i></b>.</p>
<p>Secondly I think Tom&#8217;s point is the more generic one that the current set of hints (even when converted to a stored outline) may not be sufficient to make the plan appear after a future upgrade.  This argument, by the way, is one that I use about any hinting anyway, so doesn&#8217;t really worry me in terms of being a &#8220;new&#8221; risk introduced by this code sample.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Solomon</title>
		<link>http://jonathanlewis.wordpress.com/2008/04/27/manual-optimisation/#comment-30970</link>
		<dc:creator><![CDATA[Greg Solomon]]></dc:creator>
		<pubDate>Wed, 07 May 2008 12:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=354#comment-30970</guid>
		<description><![CDATA[Hi Jonathan

Not sure if you saw my post on asktom ... basically my suggestion was to create a stored outline for the query and then put
(SELECT 1 / COUNT(*) FROM 
user_outlines WHERE NAME = &#039;OUTLINE_FOR_JL_SORT&#039;) into the FROM clause.

Tom points out that we need to look at v$parameter to make sure that the values are such that the outline will actually be used, as well.

Sound any good to you ?

Best Regards
Greg Solomon]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan</p>
<p>Not sure if you saw my post on asktom &#8230; basically my suggestion was to create a stored outline for the query and then put<br />
(SELECT 1 / COUNT(*) FROM<br />
user_outlines WHERE NAME = &#8216;OUTLINE_FOR_JL_SORT&#8217;) into the FROM clause.</p>
<p>Tom points out that we need to look at v$parameter to make sure that the values are such that the outline will actually be used, as well.</p>
<p>Sound any good to you ?</p>
<p>Best Regards<br />
Greg Solomon</p>
]]></content:encoded>
	</item>
</channel>
</rss>
