<?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: SQL Server</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2010/02/04/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Tue, 18 Jun 2013 04:32:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ronnie Doggart</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-36920</link>
		<dc:creator><![CDATA[Ronnie Doggart]]></dc:creator>
		<pubDate>Thu, 05 Aug 2010 09:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-36920</guid>
		<description><![CDATA[One think I do like about SQL Server is the Profiler tool for getting traces and seeing what exactly is going on.]]></description>
		<content:encoded><![CDATA[<p>One think I do like about SQL Server is the Profiler tool for getting traces and seeing what exactly is going on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-36422</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 04 Jun 2010 08:28:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-36422</guid>
		<description><![CDATA[Jerry,
You&#039;ve already discovered that you can play around with rownum to some effect, but it&#039;s much more complicated than SQL Server.  It sounds like SQL Server can work along the lines of:  &quot;I am aggregating and now I am stopping because I have aggregated too much&quot; whereas Oracle is generally limited by rownum to &quot;I am going to get the stuff I need to aggregate and I will stop if I find too much&quot;.  The nature of the Oracle code is restricted to the following type of thing:

[sourcecode]
select 
	/*+ gather_plan_statistics */
	count(n1)
from
	(select
		n1
	from
		t1
	where
		n1 = 5
	and	rownum &lt;= 300
	)
;

[/sourcecode]
In this case there are 500 rows that match the &quot;n1 = 5&quot; predicate in the table, but I can stop the query from working once it have found the first 300.]]></description>
		<content:encoded><![CDATA[<p>Jerry,<br />
You&#8217;ve already discovered that you can play around with rownum to some effect, but it&#8217;s much more complicated than SQL Server.  It sounds like SQL Server can work along the lines of:  &#8220;I am aggregating and now I am stopping because I have aggregated too much&#8221; whereas Oracle is generally limited by rownum to &#8220;I am going to get the stuff I need to aggregate and I will stop if I find too much&#8221;.  The nature of the Oracle code is restricted to the following type of thing:</p>
<pre class="brush: plain; title: ; notranslate">
select 
	/*+ gather_plan_statistics */
	count(n1)
from
	(select
		n1
	from
		t1
	where
		n1 = 5
	and	rownum &lt;= 300
	)
;

</pre>
<p>In this case there are 500 rows that match the &#8220;n1 = 5&#8243; predicate in the table, but I can stop the query from working once it have found the first 300.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry B</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-36412</link>
		<dc:creator><![CDATA[Jerry B]]></dc:creator>
		<pubDate>Wed, 02 Jun 2010 18:55:15 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-36412</guid>
		<description><![CDATA[One of the nice things that helps TOP is that SQL Server has a Hash Match/Flow Distinct query plan node which is used to eliminate duplicates and which pipelines.  (The downside is that the optimizer doesn&#039;t always select that node when it should.)  We have a query that checks to see if the number of rows where a person&#039;s last name starts with XXX exceeds a threshold (301 by default).  If the threshold is exceeded, then the user is prompted to make the search more restrictive.  There&#039;s no way to prevent a user from searching on &#039;Smith&#039;.  In SQL Server, we see the optimizer generate a Hash Match/Flow Distinct for duplicate elimination.  SQL Server does not have the equivalent of STATISTICS_LEVEL = ALL, but we can see by the estimated row counts and the actual # of logical reads that the scan on &#039;Smith&#039; stops when enough rows have been returned by the Hash Match/Flow Distinct.  In Oracle, we restrict on rownum we see a HASH UNIQUE for the same query and the row counts from STATISTICS_LEVEL = ALL show that HASH UNIQUE is not pipelining.  (All of the rows that start with &#039;Smith&#039; are flowing into the HASH UNIQUE.)

So, do you know of any way to get the desired pipelining in Oracle?]]></description>
		<content:encoded><![CDATA[<p>One of the nice things that helps TOP is that SQL Server has a Hash Match/Flow Distinct query plan node which is used to eliminate duplicates and which pipelines.  (The downside is that the optimizer doesn&#8217;t always select that node when it should.)  We have a query that checks to see if the number of rows where a person&#8217;s last name starts with XXX exceeds a threshold (301 by default).  If the threshold is exceeded, then the user is prompted to make the search more restrictive.  There&#8217;s no way to prevent a user from searching on &#8216;Smith&#8217;.  In SQL Server, we see the optimizer generate a Hash Match/Flow Distinct for duplicate elimination.  SQL Server does not have the equivalent of STATISTICS_LEVEL = ALL, but we can see by the estimated row counts and the actual # of logical reads that the scan on &#8216;Smith&#8217; stops when enough rows have been returned by the Hash Match/Flow Distinct.  In Oracle, we restrict on rownum we see a HASH UNIQUE for the same query and the row counts from STATISTICS_LEVEL = ALL show that HASH UNIQUE is not pipelining.  (All of the rows that start with &#8216;Smith&#8217; are flowing into the HASH UNIQUE.)</p>
<p>So, do you know of any way to get the desired pipelining in Oracle?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: I wish .. (1) &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-36388</link>
		<dc:creator><![CDATA[I wish .. (1) &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Tue, 01 Jun 2010 19:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-36388</guid>
		<description><![CDATA[[...] Server &#8212; Jonathan Lewis @ 7:45 pm UTC Jun 1,2010   I pointed out some time ago a few of the things in SQL Server that I would like to see in Oracle. Here&#8217;s a couple [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Server &#8212; Jonathan Lewis @ 7:45 pm UTC Jun 1,2010   I pointed out some time ago a few of the things in SQL Server that I would like to see in Oracle. Here&#8217;s a couple [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Back from MOW &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-36109</link>
		<dc:creator><![CDATA[Back from MOW &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 08:12:44 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-36109</guid>
		<description><![CDATA[[...] I had still had the presentation I did for Microsoft/Unisys back in February and enough time to remind myself of what was on the slides. On this occasion, though, I also had a [...]]]></description>
		<content:encoded><![CDATA[<p>[...] I had still had the presentation I did for Microsoft/Unisys back in February and enough time to remind myself of what was on the slides. On this occasion, though, I also had a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL Server 2 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-35686</link>
		<dc:creator><![CDATA[SQL Server 2 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Fri, 05 Mar 2010 09:48:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-35686</guid>
		<description><![CDATA[[...]   Following on from my posting about the presentation (about Enterprise databases) that I did at a Microsoft event on SQL Server 2008, I&#8217;ve just had an article on how to design efficient SQL published on a website that&#8217;s [...]]]></description>
		<content:encoded><![CDATA[<p>[...]   Following on from my posting about the presentation (about Enterprise databases) that I did at a Microsoft event on SQL Server 2008, I&#8217;ve just had an article on how to design efficient SQL published on a website that&#8217;s [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-35676</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 03 Mar 2010 21:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-35676</guid>
		<description><![CDATA[Zahir,

Sorry, I missed this comment when it first came up.

The problem with adaptive cursor sharing is that it has to go wrong before it goes right - and then it carries on trying to do better, so you can get constantly changing plans.

Also I don&#039;t think adaptive cursor sharing is &quot;persistent&quot;, i.e. the plans and their bind variable ranges don&#039;t get stored in the database (unlike sql base lines), so if a plan gets flushed, or when you restart the instance, you have to start making mistakes and generating new plans all over again.]]></description>
		<content:encoded><![CDATA[<p>Zahir,</p>
<p>Sorry, I missed this comment when it first came up.</p>
<p>The problem with adaptive cursor sharing is that it has to go wrong before it goes right &#8211; and then it carries on trying to do better, so you can get constantly changing plans.</p>
<p>Also I don&#8217;t think adaptive cursor sharing is &#8220;persistent&#8221;, i.e. the plans and their bind variable ranges don&#8217;t get stored in the database (unlike sql base lines), so if a plan gets flushed, or when you restart the instance, you have to start making mistakes and generating new plans all over again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zahir Mohideen</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-35558</link>
		<dc:creator><![CDATA[Zahir Mohideen]]></dc:creator>
		<pubDate>Sun, 21 Feb 2010 01:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-35558</guid>
		<description><![CDATA[Jonathan , 


Wouldn&#039;t &quot;Adaptive Cursor Sharing &quot; in 11g  minimize the diadvantages of bind variable peeking ?
Would  you consider “Optimize for” hint be close to Adaptive Cursor sharing ?

Thanks]]></description>
		<content:encoded><![CDATA[<p>Jonathan , </p>
<p>Wouldn&#8217;t &#8220;Adaptive Cursor Sharing &#8221; in 11g  minimize the diadvantages of bind variable peeking ?<br />
Would  you consider “Optimize for” hint be close to Adaptive Cursor sharing ?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-35488</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 12 Feb 2010 17:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-35488</guid>
		<description><![CDATA[Nigel,

That&#039;s the back gate - the one I slip out of under cover of darkness.]]></description>
		<content:encoded><![CDATA[<p>Nigel,</p>
<p>That&#8217;s the back gate &#8211; the one I slip out of under cover of darkness.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel</title>
		<link>http://jonathanlewis.wordpress.com/2010/02/04/sql-server/#comment-35484</link>
		<dc:creator><![CDATA[Nigel]]></dc:creator>
		<pubDate>Fri, 12 Feb 2010 10:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=2987#comment-35484</guid>
		<description><![CDATA[Hi Jonathan,

I just saw your house on Google. I like your front gate:

http://gallery.nen.gov.uk/gallery_images/0609/0000/0082/gate_mid.jpg]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>I just saw your house on Google. I like your front gate:</p>
<p><a href="http://gallery.nen.gov.uk/gallery_images/0609/0000/0082/gate_mid.jpg" rel="nofollow">http://gallery.nen.gov.uk/gallery_images/0609/0000/0082/gate_mid.jpg</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
