<?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: Full Hinting</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Thu, 23 May 2013 12:47:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Dharmendra</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-30555</link>
		<dc:creator><![CDATA[Dharmendra]]></dc:creator>
		<pubDate>Mon, 17 Mar 2008 22:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-30555</guid>
		<description><![CDATA[Reg. hint swap_join_inputs() (changing order joined tables especially build &amp; probe table in hash joins), how do you verify that oracle did what you asked it do? How do you validate if it(changing the order ) actually made a difference in performance? I mean which stat would show the difference?]]></description>
		<content:encoded><![CDATA[<p>Reg. hint swap_join_inputs() (changing order joined tables especially build &amp; probe table in hash joins), how do you verify that oracle did what you asked it do? How do you validate if it(changing the order ) actually made a difference in performance? I mean which stat would show the difference?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pythian Group Blog &#187; Log Buffer #28: a Carnival of the Vanities for DBAs</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-3913</link>
		<dc:creator><![CDATA[Pythian Group Blog &#187; Log Buffer #28: a Carnival of the Vanities for DBAs]]></dc:creator>
		<pubDate>Sat, 10 Mar 2007 02:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-3913</guid>
		<description><![CDATA[[...] his Oracle Scratchpad, Jonathan Lewis writes about hinting for optimization of plans and paths: &#8220;Ultimately there are a few dozen hints which exist but are not documented and a few dozen [...]]]></description>
		<content:encoded><![CDATA[<p>[...] his Oracle Scratchpad, Jonathan Lewis writes about hinting for optimization of plans and paths: &#8220;Ultimately there are a few dozen hints which exist but are not documented and a few dozen [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1895</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 18 Jan 2007 20:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1895</guid>
		<description><![CDATA[&lt;strong&gt;Antonio&lt;/strong&gt;, I think the increase in hints is closely related to the increase in optimizer features. Every time the designers adds a new mechanism, they have to include a hint to force the mechanism to be used in those cases where the optimizer ought to use it but fails to. Another thought is that the &quot;outline&quot; dump that appears at the end of the 10053 needs to have a hint to describe the cases where the feature is relevant. I don&#039;t really see ANSI join syntax helping very much - the optimizer still transforms the incoming query before optimising it, and you can only hint in the &lt;em&gt;select clause&lt;/em&gt;.  

&lt;strong&gt;Graham &lt;/strong&gt;, left deep and bushy - I&#039;ll try to write up a note about that some time soon. &lt;a href=&quot;http://jonathanlewis.wordpress.com/2007/01/24/left-deep-trees/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;&lt;strong&gt;[Update: now done.]&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt; Roughly speaking left-deep is what the optimizer tree looks like when a query has a single from clause with list of tables; bushy is what you get if you force Oracle to generate intermediate results.

&lt;strong&gt;Noons&lt;/strong&gt;, I think the only way an outsider could find out is to generate lots of scenarios with, and without, the first_rows hint, then compare the 10053 trace files to see what calculations were omitted when first_rows is invoked.  Generating a complete set of scenarios is, of course, the tricky bit.

&lt;strong&gt;Amit&lt;/strong&gt;, the &lt;em&gt;&lt;strong&gt;use_hash(tabX)&lt;/strong&gt;&lt;/em&gt; hint tells the optimizer to use a hash join to join this table to the preceding result set. It doesn&#039;t dictate the order at all. The swap&lt;em&gt;&lt;strong&gt;_join_inputs(tabX)&lt;/strong&gt;&lt;/em&gt; forces tabX to be the &lt;em&gt;&lt;strong&gt;build&lt;/strong&gt;&lt;/em&gt; (first) table in the join, the 10g hint &lt;em&gt;&lt;strong&gt;no_swap_join_inputs(tabX)&lt;/strong&gt;&lt;/em&gt; forces tabX to be the &lt;em&gt;&lt;strong&gt;probe&lt;/strong&gt;&lt;/em&gt; (second) table.

&lt;strong&gt;Sokrates &lt;/strong&gt;- If I&#039;ve read your syntax correctly this won&#039;t get all the hints, just the ones that happen to be used in the embedded SQL - and there are far more than that. I used to use &lt;em&gt;&lt;strong&gt;strings&lt;/strong&gt;&lt;/em&gt; on the binaries then search the text by hand for an &lt;em&gt;&quot;obvious&quot;&lt;/em&gt; hint such as &lt;em&gt;&lt;strong&gt;star_transformation&lt;/strong&gt;&lt;/em&gt;, then check any text around it. This doesn&#039;t work in 10g as the hints are now just reserved words, and don&#039;t end up grouped together in the binary. &lt;em&gt;&lt;strong&gt;[Update June 2009: In 11g you have the view v$sql_hint, listing the hints, the version they appeared in, and the version they got into stored outlines.]&lt;/strong&gt;&lt;/em&gt;


&lt;strong&gt;David &lt;/strong&gt;- I&#039;m fairly sure that the constant change in the optimizer means that some &lt;em&gt;&lt;strong&gt;outlines&lt;/strong&gt;&lt;/em&gt; won&#039;t work as expected after an upgrade. I haven&#039;t actually tested this, but I have a few easy examples that could demonstrate the principle and I will get around to testing them one day. However, it is possible that &lt;em&gt;&lt;strong&gt;outlines&lt;/strong&gt;&lt;/em&gt; are more stable than &lt;em&gt;&quot;ordinary&quot;&lt;/em&gt; end-user hints, as there is some information in the &lt;em&gt;&lt;strong&gt;outline&lt;/strong&gt;&lt;/em&gt; tables (especially in 9i) that is not available through normal hints, and this may be enough to keep the &lt;em&gt;&lt;strong&gt;outlines&lt;/strong&gt;&lt;/em&gt; on track.

&lt;strong&gt;RobH &lt;/strong&gt;- &quot;terrified&quot; is a fairly good approach, though possibly just a little over the top. Hints are NOT a good thing in production for the reaons I gave in &lt;em&gt;&lt;strong&gt;&lt;a href=&quot;http://jonathanlewis.wordpress.com/2006/11/11/what-is-a-hint/&quot; rel=&quot;nofollow&quot;&gt;an earlier article&lt;/a&gt;&lt;/strong&gt;&lt;/em&gt;.  I always advise people to minimise their use of hints, document the cases properly, and check each one carefully on any upgrade.
]]></description>
		<content:encoded><![CDATA[<p><strong>Antonio</strong>, I think the increase in hints is closely related to the increase in optimizer features. Every time the designers adds a new mechanism, they have to include a hint to force the mechanism to be used in those cases where the optimizer ought to use it but fails to. Another thought is that the &#8220;outline&#8221; dump that appears at the end of the 10053 needs to have a hint to describe the cases where the feature is relevant. I don&#8217;t really see ANSI join syntax helping very much &#8211; the optimizer still transforms the incoming query before optimising it, and you can only hint in the <em>select clause</em>.  </p>
<p><strong>Graham </strong>, left deep and bushy &#8211; I&#8217;ll try to write up a note about that some time soon. <a href="http://jonathanlewis.wordpress.com/2007/01/24/left-deep-trees/" rel="nofollow"><em><strong>[Update: now done.]</strong></em></a> Roughly speaking left-deep is what the optimizer tree looks like when a query has a single from clause with list of tables; bushy is what you get if you force Oracle to generate intermediate results.</p>
<p><strong>Noons</strong>, I think the only way an outsider could find out is to generate lots of scenarios with, and without, the first_rows hint, then compare the 10053 trace files to see what calculations were omitted when first_rows is invoked.  Generating a complete set of scenarios is, of course, the tricky bit.</p>
<p><strong>Amit</strong>, the <em><strong>use_hash(tabX)</strong></em> hint tells the optimizer to use a hash join to join this table to the preceding result set. It doesn&#8217;t dictate the order at all. The swap<em><strong>_join_inputs(tabX)</strong></em> forces tabX to be the <em><strong>build</strong></em> (first) table in the join, the 10g hint <em><strong>no_swap_join_inputs(tabX)</strong></em> forces tabX to be the <em><strong>probe</strong></em> (second) table.</p>
<p><strong>Sokrates </strong>- If I&#8217;ve read your syntax correctly this won&#8217;t get all the hints, just the ones that happen to be used in the embedded SQL &#8211; and there are far more than that. I used to use <em><strong>strings</strong></em> on the binaries then search the text by hand for an <em>&#8220;obvious&#8221;</em> hint such as <em><strong>star_transformation</strong></em>, then check any text around it. This doesn&#8217;t work in 10g as the hints are now just reserved words, and don&#8217;t end up grouped together in the binary. <em><strong>[Update June 2009: In 11g you have the view v$sql_hint, listing the hints, the version they appeared in, and the version they got into stored outlines.]</strong></em></p>
<p><strong>David </strong>- I&#8217;m fairly sure that the constant change in the optimizer means that some <em><strong>outlines</strong></em> won&#8217;t work as expected after an upgrade. I haven&#8217;t actually tested this, but I have a few easy examples that could demonstrate the principle and I will get around to testing them one day. However, it is possible that <em><strong>outlines</strong></em> are more stable than <em>&#8220;ordinary&#8221;</em> end-user hints, as there is some information in the <em><strong>outline</strong></em> tables (especially in 9i) that is not available through normal hints, and this may be enough to keep the <em><strong>outlines</strong></em> on track.</p>
<p><strong>RobH </strong>- &#8220;terrified&#8221; is a fairly good approach, though possibly just a little over the top. Hints are NOT a good thing in production for the reaons I gave in <em><strong><a href="http://jonathanlewis.wordpress.com/2006/11/11/what-is-a-hint/" rel="nofollow">an earlier article</a></strong></em>.  I always advise people to minimise their use of hints, document the cases properly, and check each one carefully on any upgrade.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RobH</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1875</link>
		<dc:creator><![CDATA[RobH]]></dc:creator>
		<pubDate>Thu, 18 Jan 2007 14:21:21 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1875</guid>
		<description><![CDATA[I&#039;m terrified of using hints in a production environment.  Its seems to &quot;conditional&quot; based on the time and state of the data and database.  Often data will change or the version of the db (even if just a patchset) and the hint is no long the best method.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m terrified of using hints in a production environment.  Its seems to &#8220;conditional&#8221; based on the time and state of the data and database.  Often data will change or the version of the db (even if just a patchset) and the hint is no long the best method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Aldridge</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1838</link>
		<dc:creator><![CDATA[David Aldridge]]></dc:creator>
		<pubDate>Thu, 18 Jan 2007 02:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1838</guid>
		<description><![CDATA[I wonder what the implications of this are for optimizer plan stability? Is it that the optimizer can achieve stability itself through the use of undocumented hints (or more complete &quot;knowledge&quot; of what the hints mean) but that it is very difficult for humans to achieve, or is it that plan stability is not absolute?]]></description>
		<content:encoded><![CDATA[<p>I wonder what the implications of this are for optimizer plan stability? Is it that the optimizer can achieve stability itself through the use of undocumented hints (or more complete &#8220;knowledge&#8221; of what the hints mean) but that it is very difficult for humans to achieve, or is it that plan stability is not absolute?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1807</link>
		<dc:creator><![CDATA[Antonio]]></dc:creator>
		<pubDate>Wed, 17 Jan 2007 16:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1807</guid>
		<description><![CDATA[@Sokrates

&quot;there is no “right join order”&quot;

Came on! :)

I mean the &quot;one that make your query fast&quot;.

I didn&#039;t mean something like &quot;left outer join&quot; nor right nor full...

I was talking about join T1 to T2 using a NL or T3 to T1 using hash...
Hope it&#039;s a bit more clear now.

&quot;why is software complexity growing ?&quot;

Only as an excuse for having more and more hints! ;-)

The optimizer gets &quot;smarter&quot; at any new Oracle release and having more hints it&#039;s like having more way to tweak the engine.
It&#039;s as good or bad as you good or bad your Oracle is configured, your statistics are gathered and so on...

More and more I keep thinking to Oracle patterns...

Bye! :-)]]></description>
		<content:encoded><![CDATA[<p>@Sokrates</p>
<p>&#8220;there is no “right join order”&#8221;</p>
<p>Came on! :)</p>
<p>I mean the &#8220;one that make your query fast&#8221;.</p>
<p>I didn&#8217;t mean something like &#8220;left outer join&#8221; nor right nor full&#8230;</p>
<p>I was talking about join T1 to T2 using a NL or T3 to T1 using hash&#8230;<br />
Hope it&#8217;s a bit more clear now.</p>
<p>&#8220;why is software complexity growing ?&#8221;</p>
<p>Only as an excuse for having more and more hints! ;-)</p>
<p>The optimizer gets &#8220;smarter&#8221; at any new Oracle release and having more hints it&#8217;s like having more way to tweak the engine.<br />
It&#8217;s as good or bad as you good or bad your Oracle is configured, your statistics are gathered and so on&#8230;</p>
<p>More and more I keep thinking to Oracle patterns&#8230;</p>
<p>Bye! :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sokrates</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1804</link>
		<dc:creator><![CDATA[Sokrates]]></dc:creator>
		<pubDate>Wed, 17 Jan 2007 15:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1804</guid>
		<description><![CDATA[does

strings `which oracle`&#124;grep &quot;\/\*\+&quot; &#124; grep &quot;\*\/&quot; &#124; sed &#039;s/\*\/.*//&#039; &#124; sed &#039;s/.*\/\*\+//&#039; &#124; tr &#039; &#039; &#039;\n&#039; &#124; dd conv=ucase &#124; sort -u 

contatin a complete list of all (documented and undocumented) Hints ?]]></description>
		<content:encoded><![CDATA[<p>does</p>
<p>strings `which oracle`|grep &#8220;\/\*\+&#8221; | grep &#8220;\*\/&#8221; | sed &#8216;s/\*\/.*//&#8217; | sed &#8216;s/.*\/\*\+//&#8217; | tr &#8216; &#8216; &#8216;\n&#8217; | dd conv=ucase | sort -u </p>
<p>contatin a complete list of all (documented and undocumented) Hints ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sokrates</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1803</link>
		<dc:creator><![CDATA[Sokrates]]></dc:creator>
		<pubDate>Wed, 17 Jan 2007 14:49:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1803</guid>
		<description><![CDATA[Antonio,

&quot;Why are hints growing?&quot;

why is software complexity growing ?

&quot;I’m thinking if the ANSI join syntax can really help (Oracle or us?) selecting the right join order.&quot;

what do you mean by &quot;the right&quot; ?

there is no &quot;right join order&quot;]]></description>
		<content:encoded><![CDATA[<p>Antonio,</p>
<p>&#8220;Why are hints growing?&#8221;</p>
<p>why is software complexity growing ?</p>
<p>&#8220;I’m thinking if the ANSI join syntax can really help (Oracle or us?) selecting the right join order.&#8221;</p>
<p>what do you mean by &#8220;the right&#8221; ?</p>
<p>there is no &#8220;right join order&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franck Pachot</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1795</link>
		<dc:creator><![CDATA[Franck Pachot]]></dc:creator>
		<pubDate>Wed, 17 Jan 2007 12:52:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1795</guid>
		<description><![CDATA[Hi,

I tried to combine the 10132 trace (that shows hints in &#039;outline data&#039; section) with the 10g dbms_sql_tune task that parses all possible execution plans for a query.

So I have the trace with all possible execution plans and their outline information. 
It can give an idea of the hints required to have the desired execution plan, but outline data gives something like:
[sourcecode]
  /*+
    BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE(&#039;10.2.0.1&#039; )
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$58A6D7F6&quot; )
      MERGE(@&quot;SEL$1&quot; )
      OUTLINE(@&quot;SEL$2&quot; ) 
      OUTLINE(@&quot;SEL$1&quot; )
      INDEX(@&quot;SEL$58A6D7F6&quot; &quot;E&quot;@&quot;SEL$1&quot; &quot;IDX$$_07E70001&quot; )
      INDEX(@&quot;SEL$58A6D7F6&quot; &quot;D&quot;@&quot;SEL$1&quot; (&quot;DEPT&quot;.&quot;DEPTNO&quot; ))
      LEADING(@&quot;SEL$58A6D7F6&quot; &quot;E&quot;@&quot;SEL$1&quot; &quot;D&quot;@&quot;SEL$1&quot; )
      USE_NL(@&quot;SEL$58A6D7F6&quot; &quot;D&quot;@&quot;SEL$1&quot; )
    END_OUTLINE_DATA
  */
[/sourcecode]
and I had to translate it to the following hints: /*+ INDEX(E PK_EMP) INDEX (D (DEPT.DEPTNO)) LEADING (E D) USE_NL(D) */

But I have no idea what means &quot;IDX$$_07E70001&quot; - and, by the way, I didn&#039;t know about the INDEX( ()) syntax 
Maybe you have more information about it.

I think this can help having &#039;full hinting&#039; for a query.

Regards,
Franck.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I tried to combine the 10132 trace (that shows hints in &#8216;outline data&#8217; section) with the 10g dbms_sql_tune task that parses all possible execution plans for a query.</p>
<p>So I have the trace with all possible execution plans and their outline information.<br />
It can give an idea of the hints required to have the desired execution plan, but outline data gives something like:</p>
<pre class="brush: plain; title: ; notranslate">
  /*+
    BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('10.2.0.1' )
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$58A6D7F6&quot; )
      MERGE(@&quot;SEL$1&quot; )
      OUTLINE(@&quot;SEL$2&quot; ) 
      OUTLINE(@&quot;SEL$1&quot; )
      INDEX(@&quot;SEL$58A6D7F6&quot; &quot;E&quot;@&quot;SEL$1&quot; &quot;IDX$$_07E70001&quot; )
      INDEX(@&quot;SEL$58A6D7F6&quot; &quot;D&quot;@&quot;SEL$1&quot; (&quot;DEPT&quot;.&quot;DEPTNO&quot; ))
      LEADING(@&quot;SEL$58A6D7F6&quot; &quot;E&quot;@&quot;SEL$1&quot; &quot;D&quot;@&quot;SEL$1&quot; )
      USE_NL(@&quot;SEL$58A6D7F6&quot; &quot;D&quot;@&quot;SEL$1&quot; )
    END_OUTLINE_DATA
  */
</pre>
<p>and I had to translate it to the following hints: /*+ INDEX(E PK_EMP) INDEX (D (DEPT.DEPTNO)) LEADING (E D) USE_NL(D) */</p>
<p>But I have no idea what means &#8220;IDX$$_07E70001&#8243; &#8211; and, by the way, I didn&#8217;t know about the INDEX( ()) syntax<br />
Maybe you have more information about it.</p>
<p>I think this can help having &#8216;full hinting&#8217; for a query.</p>
<p>Regards,<br />
Franck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amit poddar</title>
		<link>http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1794</link>
		<dc:creator><![CDATA[amit poddar]]></dc:creator>
		<pubDate>Wed, 17 Jan 2007 12:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/01/16/full-hinting/#comment-1794</guid>
		<description><![CDATA[&quot;but the  swap_join_inputs() would make t2 the build (first) table and the intermediate result the probe (second) table in the hash join.&quot;

Does that mean that use_hash(t) means that &quot;use t as the probe table&quot; in the hash join ?]]></description>
		<content:encoded><![CDATA[<p>&#8220;but the  swap_join_inputs() would make t2 the build (first) table and the intermediate result the probe (second) table in the hash join.&#8221;</p>
<p>Does that mean that use_hash(t) means that &#8220;use t as the probe table&#8221; in the hash join ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
