<?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: Logical tuning</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 22 May 2013 12:40:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Unnesting disjunctive subqueries (with OR predicate) &#171; Timur Akhmadeev&#039;s blog</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46971</link>
		<dc:creator><![CDATA[Unnesting disjunctive subqueries (with OR predicate) &#171; Timur Akhmadeev&#039;s blog]]></dc:creator>
		<pubDate>Thu, 07 Jun 2012 09:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46971</guid>
		<description><![CDATA[[...] Lewis has recently posted a good example of CBO not good enough in transforming specific query types. A recent thread on the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Lewis has recently posted a good example of CBO not good enough in transforming specific query types. A recent thread on the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46682</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 27 May 2012 06:18:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46682</guid>
		<description><![CDATA[Narenda,

Thanks for making that comment. I should have stated explicitly that the query was not logically the same and could be expected to return a different answer. The reason for the comparison was to point out that a surprisingly similar type of query (equality on two columns out of three). In fact I think I&#039;ve even seen cases where the optimizer has turned &lt;i&gt;&quot;in (list of values)&quot;&lt;/i&gt; into a range scan that discarded unwanted values - I&#039;ll have to see if I can find time to engineer an example.]]></description>
		<content:encoded><![CDATA[<p>Narenda,</p>
<p>Thanks for making that comment. I should have stated explicitly that the query was not logically the same and could be expected to return a different answer. The reason for the comparison was to point out that a surprisingly similar type of query (equality on two columns out of three). In fact I think I&#8217;ve even seen cases where the optimizer has turned <i>&#8220;in (list of values)&#8221;</i> into a range scan that discarded unwanted values &#8211; I&#8217;ll have to see if I can find time to engineer an example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narendra</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46666</link>
		<dc:creator><![CDATA[Narendra]]></dc:creator>
		<pubDate>Sat, 26 May 2012 23:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46666</guid>
		<description><![CDATA[Jonathan,

Thanks for sharing the problem and excellent analysis of it as well as the clever solution.
Just one doubt. You said in the &quot;Update&quot; &lt;i&gt;On the other hand, it is possible to get unnesting and a hash anti-join with the predicate: id3 between id2 and id2 + 1000&lt;/i&gt;.
But won&#039;t that make the query different to the original query? &lt;b&gt;id3 between id2 and id2 + 1000&lt;/b&gt; is not equivalent to &lt;b&gt;(id3 = id2 or id3 = id2 + 1000)&lt;/b&gt;. Or is it because of the nature of data that these two predicates will produce same results? Or did I miss something obvious?]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>Thanks for sharing the problem and excellent analysis of it as well as the clever solution.<br />
Just one doubt. You said in the &#8220;Update&#8221; <i>On the other hand, it is possible to get unnesting and a hash anti-join with the predicate: id3 between id2 and id2 + 1000</i>.<br />
But won&#8217;t that make the query different to the original query? <b>id3 between id2 and id2 + 1000</b> is not equivalent to <b>(id3 = id2 or id3 = id2 + 1000)</b>. Or is it because of the nature of data that these two predicates will produce same results? Or did I miss something obvious?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Subquery Factoring &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46611</link>
		<dc:creator><![CDATA[Subquery Factoring &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Thu, 24 May 2012 18:38:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46611</guid>
		<description><![CDATA[[...] example of Oracle&#8217;s code not behaving consistently. You may recognise the basic query from yesterday&#8217;s example of logical tuning &#8211; so I won&#8217;t reprint the code to generate the data sets. This examples in this note [...]]]></description>
		<content:encoded><![CDATA[<p>[...] example of Oracle&#8217;s code not behaving consistently. You may recognise the basic query from yesterday&#8217;s example of logical tuning &#8211; so I won&#8217;t reprint the code to generate the data sets. This examples in this note [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46610</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 24 May 2012 18:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46610</guid>
		<description><![CDATA[Mauro,

Thanks for the follow-up.]]></description>
		<content:encoded><![CDATA[<p>Mauro,</p>
<p>Thanks for the follow-up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mauro Pagano</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46609</link>
		<dc:creator><![CDATA[Mauro Pagano]]></dc:creator>
		<pubDate>Thu, 24 May 2012 15:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46609</guid>
		<description><![CDATA[Hi Jonathan,

Yes as of now the CBO does not unnest correlated subquery with OR predicates, ER 14113785 has been filed about it
Non-correlated are covered by fix for Bug 9143856, details in Doc ID 9143856.8]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Yes as of now the CBO does not unnest correlated subquery with OR predicates, ER 14113785 has been filed about it<br />
Non-correlated are covered by fix for Bug 9143856, details in Doc ID 9143856.8</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46607</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 24 May 2012 12:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46607</guid>
		<description><![CDATA[Valentin,

I had a look at both bugs (this comment, and the next), and I don&#039;t think either of them really relates to the shape of query I have. Both are about semi-joins, and the 10g bug relates to tableA with subquery being joined to tableB with subquery, and the positioning of the two separate subqueries.

Given my additional comment about the query working with a range predicate for the third column - it really does look as if a concatenation (or probably inlist iterator) method could and should apply in this case inside the unnest.]]></description>
		<content:encoded><![CDATA[<p>Valentin,</p>
<p>I had a look at both bugs (this comment, and the next), and I don&#8217;t think either of them really relates to the shape of query I have. Both are about semi-joins, and the 10g bug relates to tableA with subquery being joined to tableB with subquery, and the positioning of the two separate subqueries.</p>
<p>Given my additional comment about the query working with a range predicate for the third column &#8211; it really does look as if a concatenation (or probably inlist iterator) method could and should apply in this case inside the unnest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46594</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 24 May 2012 09:38:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46594</guid>
		<description><![CDATA[Timur,

We didn&#039;t raise an SR - it&#039;s the usual problem, once you&#039;ve worked around a problem you move on to the next one.  It would have taken a couple of hours to raise the SR. It&#039;s possible that someone from Oracle might read the blog though, and follow it up.]]></description>
		<content:encoded><![CDATA[<p>Timur,</p>
<p>We didn&#8217;t raise an SR &#8211; it&#8217;s the usual problem, once you&#8217;ve worked around a problem you move on to the next one.  It would have taken a couple of hours to raise the SR. It&#8217;s possible that someone from Oracle might read the blog though, and follow it up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46593</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 24 May 2012 09:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46593</guid>
		<description><![CDATA[Vijay,
Thanks for reporting the error. Now corrected.]]></description>
		<content:encoded><![CDATA[<p>Vijay,<br />
Thanks for reporting the error. Now corrected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timur Akhmadeev</title>
		<link>http://jonathanlewis.wordpress.com/2012/05/23/logical-tuning/#comment-46590</link>
		<dc:creator><![CDATA[Timur Akhmadeev]]></dc:creator>
		<pubDate>Thu, 24 May 2012 07:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=8927#comment-46590</guid>
		<description><![CDATA[Jonathan

again the &quot;less than&quot; issue.
I&#039;ve checked this on 11.2.0.3 and it shows same behavior with the same message in 10053 trace.
And a question: did your client file an SR for this trouble? I think that would be a very nice feature request to the optimizer team, especially since they already can do opposite type of transformation called &lt;a href=&quot;http://www.vldb.org/pvldb/2/vldb09-423.pdf&quot; rel=&quot;nofollow&quot;&gt;coalescing&lt;/a&gt; with multiple subqueries (in some cases).]]></description>
		<content:encoded><![CDATA[<p>Jonathan</p>
<p>again the &#8220;less than&#8221; issue.<br />
I&#8217;ve checked this on 11.2.0.3 and it shows same behavior with the same message in 10053 trace.<br />
And a question: did your client file an SR for this trouble? I think that would be a very nice feature request to the optimizer team, especially since they already can do opposite type of transformation called <a href="http://www.vldb.org/pvldb/2/vldb09-423.pdf" rel="nofollow">coalescing</a> with multiple subqueries (in some cases).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
