<?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"
	>
<channel>
	<title>Comments on: Do SQL Plan Baselines Use Hints?</title>
	<atom:link href="http://kerryosborne.oracle-guy.com/2009/04/do-sql-plan-baselines-use-hints/feed/" rel="self" type="application/rss+xml" />
	<link>http://kerryosborne.oracle-guy.com/2009/04/do-sql-plan-baselines-use-hints/</link>
	<description>Just another Oracle blog</description>
	<pubDate>Thu, 29 Jul 2010 12:06:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/do-sql-plan-baselines-use-hints/#comment-967</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Thu, 23 Apr 2009 15:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1132#comment-967</guid>
		<description>Thanks for your comments. I just posted an update "Do Baselines Use Hints - Take 2" and I agree with you. It kept bugging me that I couldn't find a place where the plan steps were actually stored. I could only find the plan hash value, so I did some more looking at 10053 trace files and it appears to me that the hints are actually used to attempt to match the plan hash value and if the optimizer can't reproduce and exact match for some reason, it falls back to normal optimization. This is better than coming up with a different plan and not knowing it, as Outlines or SQL Profiles can do, but it is not quite what I was hoping for.

And yes, the outline section of XPLAN shows hints that the optimizer thinks are necessary to reproduce the plan (I think that's what you were asking in the last sentence).

Kerry</description>
		<content:encoded><![CDATA[<p>Thanks for your comments. I just posted an update &#8220;Do Baselines Use Hints - Take 2&#8243; and I agree with you. It kept bugging me that I couldn&#8217;t find a place where the plan steps were actually stored. I could only find the plan hash value, so I did some more looking at 10053 trace files and it appears to me that the hints are actually used to attempt to match the plan hash value and if the optimizer can&#8217;t reproduce and exact match for some reason, it falls back to normal optimization. This is better than coming up with a different plan and not knowing it, as Outlines or SQL Profiles can do, but it is not quite what I was hoping for.</p>
<p>And yes, the outline section of XPLAN shows hints that the optimizer thinks are necessary to reproduce the plan (I think that&#8217;s what you were asking in the last sentence).</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry Osborne&#8217;s Oracle Blog &#187; Blog Archive Do SQL Plan Baselines Use Hints? - Take 2 - Kerry Osborne’s Oracle Blog</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/do-sql-plan-baselines-use-hints/#comment-966</link>
		<dc:creator>Kerry Osborne&#8217;s Oracle Blog &#187; Blog Archive Do SQL Plan Baselines Use Hints? - Take 2 - Kerry Osborne’s Oracle Blog</dc:creator>
		<pubDate>Thu, 23 Apr 2009 15:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1132#comment-966</guid>
		<description>[...] I no longer think that Baselines store an actual plan for a SQL statement. (See my previous post - Do SQL Plan Baselines Use Hints?) I never could find a place where the plan data was stored (only the plan_hash_value). So I had a [...]</description>
		<content:encoded><![CDATA[<p>[...] I no longer think that Baselines store an actual plan for a SQL statement. (See my previous post - Do SQL Plan Baselines Use Hints?) I never could find a place where the plan data was stored (only the plan_hash_value). So I had a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Coskan</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/do-sql-plan-baselines-use-hints/#comment-965</link>
		<dc:creator>Coskan</dc:creator>
		<pubDate>Thu, 23 Apr 2009 15:26:42 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1132#comment-965</guid>
		<description>You said " “Do SQL Plan Baselines use hints?”. The answer is … I don’t think so.  "

Christian Antognini said in his book on page 298  

"Unfortunately, to display the list of hints associated with a SQL plan baseline, undocumented
data dictionary tables must be queried. The following SQL statement shows an example.
Note that since hints are stored in XML format, a conversion is necessary to have a readable
output." 
SQL&#62; SELECT extractValue(value(h),'.') AS hint
2 FROM sys.sqlobj$data od, sys.sqlobj$ so,
3 table(xmlsequence(extract(xmltype(od.comp_data),'/outline_data/hint'))) h
4 WHERE so.name = 'SYS_SQL_PLAN_8fb2691f3fdbb376'
5 AND so.signature = od.signature
6 AND so.category = od.category
7 AND so.obj_type = od.obj_type
8 AND so.plan_id = od.plan_id;


I am a bit confused Arent those listed in OUTLINE section are hints  like       FULL(@"SEL$1" "SKEW"@"SEL$1")</description>
		<content:encoded><![CDATA[<p>You said &#8221; “Do SQL Plan Baselines use hints?”. The answer is … I don’t think so.  &#8221;</p>
<p>Christian Antognini said in his book on page 298  </p>
<p>&#8220;Unfortunately, to display the list of hints associated with a SQL plan baseline, undocumented<br />
data dictionary tables must be queried. The following SQL statement shows an example.<br />
Note that since hints are stored in XML format, a conversion is necessary to have a readable<br />
output.&#8221;<br />
SQL&gt; SELECT extractValue(value(h),&#8217;.') AS hint<br />
2 FROM sys.sqlobj$data od, sys.sqlobj$ so,<br />
3 table(xmlsequence(extract(xmltype(od.comp_data),&#8217;/outline_data/hint&#8217;))) h<br />
4 WHERE so.name = &#8216;SYS_SQL_PLAN_8fb2691f3fdbb376&#8242;<br />
5 AND so.signature = od.signature<br />
6 AND so.category = od.category<br />
7 AND so.obj_type = od.obj_type<br />
8 AND so.plan_id = od.plan_id;</p>
<p>I am a bit confused Arent those listed in OUTLINE section are hints  like       FULL(@&#8221;SEL$1&#8243; &#8220;SKEW&#8221;@&#8221;SEL$1&#8243;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/do-sql-plan-baselines-use-hints/#comment-900</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 20 Apr 2009 19:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1132#comment-900</guid>
		<description>On the other hand, I have not been able to find where the plan is actually stored for a Baseline. And I have seen the optimizer refuse to use a Baseline created on a hinted statement when attached to a non-hinted version of the same statement. In this case the 10053 trace said:

SPM: planId in plan baseline = 803197271, planId of reproduced plan = 2333352146
------- START SPM Plan Dump -------
SPM: failed to reproduce the plan using the following info:
 parse_schema name        : SYS
 plan_baseline signature  : 1872586980585244352
 plan_baseline plan_id    : 803197271
 plan_baseline hintset    :
   hint num  1 len 27 text: IGNORE_OPTIM_EMBEDDED_HINTS
   hint num  2 len 37 text: OPTIMIZER_FEATURES_ENABLE('11.1.0.7')
   hint num  3 len 22 text: DB_VERSION('11.1.0.7')
   hint num  4 len  8 text: ALL_ROWS
   hint num  5 len 22 text: OUTLINE_LEAF(@"SEL$1")
   hint num  6 len 57 text: INDEX_RS_ASC(@"SEL$1" "A"@"SEL$1" ("LITTLE_SKEW"."COL1"))
SPM: generated non-matching plan:

hmmmm ...</description>
		<content:encoded><![CDATA[<p>On the other hand, I have not been able to find where the plan is actually stored for a Baseline. And I have seen the optimizer refuse to use a Baseline created on a hinted statement when attached to a non-hinted version of the same statement. In this case the 10053 trace said:</p>
<p>SPM: planId in plan baseline = 803197271, planId of reproduced plan = 2333352146<br />
&#8212;&#8212;- START SPM Plan Dump &#8212;&#8212;-<br />
SPM: failed to reproduce the plan using the following info:<br />
 parse_schema name        : SYS<br />
 plan_baseline signature  : 1872586980585244352<br />
 plan_baseline plan_id    : 803197271<br />
 plan_baseline hintset    :<br />
   hint num  1 len 27 text: IGNORE_OPTIM_EMBEDDED_HINTS<br />
   hint num  2 len 37 text: OPTIMIZER_FEATURES_ENABLE(&#8217;11.1.0.7&#8242;)<br />
   hint num  3 len 22 text: DB_VERSION(&#8217;11.1.0.7&#8242;)<br />
   hint num  4 len  8 text: ALL_ROWS<br />
   hint num  5 len 22 text: OUTLINE_LEAF(@&#8221;SEL$1&#8243;)<br />
   hint num  6 len 57 text: INDEX_RS_ASC(@&#8221;SEL$1&#8243; &#8220;A&#8221;@&#8221;SEL$1&#8243; (&#8221;LITTLE_SKEW&#8221;.&#8221;COL1&#8243;))<br />
SPM: generated non-matching plan:</p>
<p>hmmmm &#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
