<?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: Proving that 1=2, is Oracle Wrong to Short-Circuit an Execution Plan?</title>
	<atom:link href="http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Thu, 23 May 2013 04:02:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/#comment-3532</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Thu, 23 Jun 2011 01:03:08 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=480#comment-3532</guid>
		<description><![CDATA[Troy,

Yes, exactly.  That was also the point that Maxim made with his clever statement, &quot;consider two infinities equal to each other&quot; - in other words, divide by 0 and you obtain infinity.  

I believe that Maxim stated it as such to give people a little more time to think about the problem and how it might be a larger statement related to Oracle.  I don&#039;t think that we ever reached the part of the larger statement about Oracle Database.  Maybe something like the following:
* If you break the commonly accepted rules, you could see impossible results.
* A vertical 8 and a horizontal 8 (the symbol for infinity) are not the same thing - using information out of context could lead to significant problems.
* Even though a 0 and an empty set symbol ( Ø ) look similar, the two have very different meanings.  I believe that someone tried to use this logic to prove that Oracle supports multiple block sizes for performance because it supports the KEEP and RECYCLE pools.  :-)
* If you set out to prove something, make certain that you are proving what you think that you are proving.

Any other ideas about the larger meaning in the context of Oracle Database?]]></description>
		<content:encoded><![CDATA[<p>Troy,</p>
<p>Yes, exactly.  That was also the point that Maxim made with his clever statement, &#8220;consider two infinities equal to each other&#8221; &#8211; in other words, divide by 0 and you obtain infinity.  </p>
<p>I believe that Maxim stated it as such to give people a little more time to think about the problem and how it might be a larger statement related to Oracle.  I don&#8217;t think that we ever reached the part of the larger statement about Oracle Database.  Maybe something like the following:<br />
* If you break the commonly accepted rules, you could see impossible results.<br />
* A vertical 8 and a horizontal 8 (the symbol for infinity) are not the same thing &#8211; using information out of context could lead to significant problems.<br />
* Even though a 0 and an empty set symbol ( Ø ) look similar, the two have very different meanings.  I believe that someone tried to use this logic to prove that Oracle supports multiple block sizes for performance because it supports the KEEP and RECYCLE pools.  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
* If you set out to prove something, make certain that you are proving what you think that you are proving.</p>
<p>Any other ideas about the larger meaning in the context of Oracle Database?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Troy</title>
		<link>http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/#comment-3531</link>
		<dc:creator><![CDATA[Troy]]></dc:creator>
		<pubDate>Thu, 23 Jun 2011 00:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=480#comment-3531</guid>
		<description><![CDATA[The only reason No. 6 is true is because of the fact that a==b or (a-b)==0; we cannot divide both sides by (a-b) or 0 to get No. 7. 
x*0==y*0 does not prove x==y.]]></description>
		<content:encoded><![CDATA[<p>The only reason No. 6 is true is because of the fact that a==b or (a-b)==0; we cannot divide both sides by (a-b) or 0 to get No. 7.<br />
x*0==y*0 does not prove x==y.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/#comment-88</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Sat, 02 Jan 2010 12:38:48 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=480#comment-88</guid>
		<description><![CDATA[I did not want to spoil the fun for everyone else - Maxim is correct regarding the proof.

If a=b then (a-b)=0, so in step 7 the proof is essentially dividing by 0.  I remember the first time I saw the proof - I paused at step 6, trying to make certain that the change on the left side of the equation [a^2 - b^2 to (a + b) * (a - b)] was permitted/legal - that the two were equivalent.  After verifying that the professor did not pull a fast one at that step, I moved on to the next step, competely losing sight of the assumption at the start of the proof that a=b.  So, it was not a basic algebra equation that brought down the proof, but something more basic - dividing by 0 is not permitted (as the divisor approaches 0, the equation result grows infinitely large, as pointed out by Maxim).]]></description>
		<content:encoded><![CDATA[<p>I did not want to spoil the fun for everyone else &#8211; Maxim is correct regarding the proof.</p>
<p>If a=b then (a-b)=0, so in step 7 the proof is essentially dividing by 0.  I remember the first time I saw the proof &#8211; I paused at step 6, trying to make certain that the change on the left side of the equation [a^2 - b^2 to (a + b) * (a - b)] was permitted/legal &#8211; that the two were equivalent.  After verifying that the professor did not pull a fast one at that step, I moved on to the next step, competely losing sight of the assumption at the start of the proof that a=b.  So, it was not a basic algebra equation that brought down the proof, but something more basic &#8211; dividing by 0 is not permitted (as the divisor approaches 0, the equation result grows infinitely large, as pointed out by Maxim).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/#comment-48</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Fri, 25 Dec 2009 15:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=480#comment-48</guid>
		<description><![CDATA[Maxim, thanks for the comments.  

I wonder if there is a deeper lesson in the proof that may be applied to Oracle databases, keeping in mind the description of mathematical proofs provided by the paper on the math.harvard.edu website.  Mathematical type proofs are quite helpful for describing Oracle behavior, as long as the person preparing the proof does not ignore simple rules.  Maybe the lesson is even deeper yet?

Incidentally, those are interesting queries and results.  Here is what a portion of a 10053 trace file has to say about the first query:

[code]
******************************************
----- Current SQL Statement for this session (sql_id=15x9pv81bs0hs) -----
select dummy from dual where 2f/0f=3f/0f
*******************************************
...
FPD: Considering simple filter push in query block SEL$1 (#0)
BINARY_FLOAT_INFINITY=BINARY_FLOAT_INFINITY
try to generate transitive predicate from check constraints for query block SEL$1 (#0)
finally: BINARY_FLOAT_INFINITY=BINARY_FLOAT_INFINITY
...
Final query after transformations:******* UNPARSED QUERY IS *******
SELECT &quot;DUAL&quot;.&quot;DUMMY&quot; &quot;DUMMY&quot; FROM &quot;SYS&quot;.&quot;DUAL&quot; &quot;DUAL&quot; WHERE BINARY_FLOAT_INFINITY=BINARY_FLOAT_INFINITY
...
============
Plan Table
============
-------------------------------------+-----------------------------------+
&#124; Id  &#124; Operation          &#124; Name    &#124; Rows  &#124; Bytes &#124; Cost  &#124; Time      &#124;
-------------------------------------+-----------------------------------+
&#124; 0   &#124; SELECT STATEMENT   &#124;         &#124;       &#124;       &#124;     2 &#124;           &#124;
&#124; 1   &#124;  TABLE ACCESS FULL &#124; DUAL    &#124;     1 &#124;     2 &#124;     2 &#124;  00:00:01 &#124;
-------------------------------------+-----------------------------------+
Predicate Information:
----------------------
Content of other_xml column
...
[/code]

Here is the partial 10053 trace file output for the second query:

[code]
******************************************
----- Current SQL Statement for this session (sql_id=3xzpa61x251bn) -----
select dummy from dual where 3*(1/3) = 1
*******************************************
...
FPD: Considering simple filter push in query block SEL$1 (#0)
.9999999999999999999999999999999999999999=1
try to generate transitive predicate from check constraints for query block SEL$1 (#0)
finally: .9999999999999999999999999999999999999999=1
...
Final query after transformations:******* UNPARSED QUERY IS *******
SELECT &quot;DUAL&quot;.&quot;DUMMY&quot; &quot;DUMMY&quot; FROM &quot;SYS&quot;.&quot;DUAL&quot; &quot;DUAL&quot; WHERE .9999999999999999999999999999999999999999=1
...
============
Plan Table
============
--------------------------------------+-----------------------------------+
&#124; Id  &#124; Operation           &#124; Name    &#124; Rows  &#124; Bytes &#124; Cost  &#124; Time      &#124;
--------------------------------------+-----------------------------------+
&#124; 0   &#124; SELECT STATEMENT    &#124;         &#124;       &#124;       &#124;     1 &#124;           &#124;
&#124; 1   &#124;  FILTER             &#124;         &#124;       &#124;       &#124;       &#124;           &#124;
&#124; 2   &#124;   TABLE ACCESS FULL &#124; DUAL    &#124;     1 &#124;     2 &#124;     2 &#124;  00:00:01 &#124;
--------------------------------------+-----------------------------------+
Predicate Information:
----------------------
1 - filter(NULL IS NOT NULL)
Content of other_xml column
...
[/code]

Notice in the above that the query optimizer has completely eliminated the WHERE clause in the first query based on the output of the &quot;Predicate Information&quot; section of the plan.  Note also how Oracle transformed the query that was submitted.  

The second query produced the same type of plan that I showed in &lt;a href=&quot;http://hoopercharles.wordpress.com/2009/12/01/what-happens-when-12-is-included-in-a-where-clause/&quot; rel=&quot;nofollow&quot;&gt;this blog entry&lt;/a&gt;.  Note that Oracle also transformed the second SQL statement.  

This raises the question, are these just bugs in the query optimizer?]]></description>
		<content:encoded><![CDATA[<p>Maxim, thanks for the comments.  </p>
<p>I wonder if there is a deeper lesson in the proof that may be applied to Oracle databases, keeping in mind the description of mathematical proofs provided by the paper on the math.harvard.edu website.  Mathematical type proofs are quite helpful for describing Oracle behavior, as long as the person preparing the proof does not ignore simple rules.  Maybe the lesson is even deeper yet?</p>
<p>Incidentally, those are interesting queries and results.  Here is what a portion of a 10053 trace file has to say about the first query:</p>
<pre class="brush: plain; title: ; notranslate">
******************************************
----- Current SQL Statement for this session (sql_id=15x9pv81bs0hs) -----
select dummy from dual where 2f/0f=3f/0f
*******************************************
...
FPD: Considering simple filter push in query block SEL$1 (#0)
BINARY_FLOAT_INFINITY=BINARY_FLOAT_INFINITY
try to generate transitive predicate from check constraints for query block SEL$1 (#0)
finally: BINARY_FLOAT_INFINITY=BINARY_FLOAT_INFINITY
...
Final query after transformations:******* UNPARSED QUERY IS *******
SELECT &quot;DUAL&quot;.&quot;DUMMY&quot; &quot;DUMMY&quot; FROM &quot;SYS&quot;.&quot;DUAL&quot; &quot;DUAL&quot; WHERE BINARY_FLOAT_INFINITY=BINARY_FLOAT_INFINITY
...
============
Plan Table
============
-------------------------------------+-----------------------------------+
| Id  | Operation          | Name    | Rows  | Bytes | Cost  | Time      |
-------------------------------------+-----------------------------------+
| 0   | SELECT STATEMENT   |         |       |       |     2 |           |
| 1   |  TABLE ACCESS FULL | DUAL    |     1 |     2 |     2 |  00:00:01 |
-------------------------------------+-----------------------------------+
Predicate Information:
----------------------
Content of other_xml column
...
</pre>
<p>Here is the partial 10053 trace file output for the second query:</p>
<pre class="brush: plain; title: ; notranslate">
******************************************
----- Current SQL Statement for this session (sql_id=3xzpa61x251bn) -----
select dummy from dual where 3*(1/3) = 1
*******************************************
...
FPD: Considering simple filter push in query block SEL$1 (#0)
.9999999999999999999999999999999999999999=1
try to generate transitive predicate from check constraints for query block SEL$1 (#0)
finally: .9999999999999999999999999999999999999999=1
...
Final query after transformations:******* UNPARSED QUERY IS *******
SELECT &quot;DUAL&quot;.&quot;DUMMY&quot; &quot;DUMMY&quot; FROM &quot;SYS&quot;.&quot;DUAL&quot; &quot;DUAL&quot; WHERE .9999999999999999999999999999999999999999=1
...
============
Plan Table
============
--------------------------------------+-----------------------------------+
| Id  | Operation           | Name    | Rows  | Bytes | Cost  | Time      |
--------------------------------------+-----------------------------------+
| 0   | SELECT STATEMENT    |         |       |       |     1 |           |
| 1   |  FILTER             |         |       |       |       |           |
| 2   |   TABLE ACCESS FULL | DUAL    |     1 |     2 |     2 |  00:00:01 |
--------------------------------------+-----------------------------------+
Predicate Information:
----------------------
1 - filter(NULL IS NOT NULL)
Content of other_xml column
...
</pre>
<p>Notice in the above that the query optimizer has completely eliminated the WHERE clause in the first query based on the output of the &#8220;Predicate Information&#8221; section of the plan.  Note also how Oracle transformed the query that was submitted.  </p>
<p>The second query produced the same type of plan that I showed in <a href="http://hoopercharles.wordpress.com/2009/12/01/what-happens-when-12-is-included-in-a-where-clause/" rel="nofollow">this blog entry</a>.  Note that Oracle also transformed the second SQL statement.  </p>
<p>This raises the question, are these just bugs in the query optimizer?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxim</title>
		<link>http://hoopercharles.wordpress.com/2009/12/25/proving-that-12-is-oracle-wrong-to-short-circuit-an-execution-plan/#comment-47</link>
		<dc:creator><![CDATA[Maxim]]></dc:creator>
		<pubDate>Fri, 25 Dec 2009 08:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=480#comment-47</guid>
		<description><![CDATA[Well, the lesson might be, that Oracle ( like you from step 7 onwards ;-) ) consider two infinities equal to each other:

SQL&gt; select dummy from dual where 2f/0f=3f/0f;

D
-
X

I think btw, it could be interesting as well to show, how Oracle produce &quot;wrong&quot; results in queries like
select dummy from dual where 3*(1/3) = 1;
seems to be well known fact about numbers precision, but people tend to forget about it again and again ...
Best regards

Maxim]]></description>
		<content:encoded><![CDATA[<p>Well, the lesson might be, that Oracle ( like you from step 7 onwards <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) consider two infinities equal to each other:</p>
<p>SQL&gt; select dummy from dual where 2f/0f=3f/0f;</p>
<p>D<br />
-<br />
X</p>
<p>I think btw, it could be interesting as well to show, how Oracle produce &#8220;wrong&#8221; results in queries like<br />
select dummy from dual where 3*(1/3) = 1;<br />
seems to be well known fact about numbers precision, but people tend to forget about it again and again &#8230;<br />
Best regards</p>
<p>Maxim</p>
]]></content:encoded>
	</item>
</channel>
</rss>
