<?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/"
		>
<channel>
	<title>Comments on: An example exec plan</title>
	<atom:link href="http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/</link>
	<description>A discussion on SQL Server</description>
	<lastBuildDate>Mon, 14 May 2012 23:51:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-1338</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Sat, 01 Jan 2011 17:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-1338</guid>
		<description>John, for a more detailed look at that, try this post: http://sqlinthewild.co.za/index.php/2009/09/22/estimated-rows-actual-rows-and-execution-count/</description>
		<content:encoded><![CDATA[<p>John, for a more detailed look at that, try this post: <a href="http://sqlinthewild.co.za/index.php/2009/09/22/estimated-rows-actual-rows-and-execution-count/" rel="nofollow">http://sqlinthewild.co.za/index.php/2009/09/22/estimated-rows-actual-rows-and-execution-count/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Alan</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-1337</link>
		<dc:creator>John Alan</dc:creator>
		<pubDate>Sat, 01 Jan 2011 16:48:59 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-1337</guid>
		<description>Gail,

Thanks for clearing up the fact that there is no cardinality error in the estimate of the key lookup (1 vs 16). With no visibility of the number of executions it would be all too easy to waste time investigating statistics that are neither missing nor stale.

Excellent blog, keep up the good work!</description>
		<content:encoded><![CDATA[<p>Gail,</p>
<p>Thanks for clearing up the fact that there is no cardinality error in the estimate of the key lookup (1 vs 16). With no visibility of the number of executions it would be all too easy to waste time investigating statistics that are neither missing nor stale.</p>
<p>Excellent blog, keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nagi</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-118</link>
		<dc:creator>Nagi</dc:creator>
		<pubDate>Mon, 22 Jun 2009 17:59:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-118</guid>
		<description>Thanks Gali for clarification. I&#039;m gaining so much good info from all of your posts.</description>
		<content:encoded><![CDATA[<p>Thanks Gali for clarification. I&#8217;m gaining so much good info from all of your posts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-117</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Mon, 22 Jun 2009 10:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-117</guid>
		<description>A clustered index seek is a legitimate operator. It&#039;s, as it&#039;s name says, a seek on a clustered index. In 2005 RTM and SP1 both true Clustered index seeks and bookmark lookups appeared in the plan as clustered index seeks. In SP2 onwards, the lookups are key/RID lookups and the clustered index seeks in the plan are actual clustered index seeks.</description>
		<content:encoded><![CDATA[<p>A clustered index seek is a legitimate operator. It&#8217;s, as it&#8217;s name says, a seek on a clustered index. In 2005 RTM and SP1 both true Clustered index seeks and bookmark lookups appeared in the plan as clustered index seeks. In SP2 onwards, the lookups are key/RID lookups and the clustered index seeks in the plan are actual clustered index seeks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nagi</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-116</link>
		<dc:creator>Nagi</dc:creator>
		<pubDate>Mon, 22 Jun 2009 05:04:39 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-116</guid>
		<description>Gali, I read in msdn forums that Bookmark Lookup(SQL 2000 or before)=Clustered Index seek (SQL 2005 RTM &amp; SP1) = Key Lookup (SQL 2005 SP2 &amp; later)..then how come we have both Key Lookup &amp; Clustered Index Seek in the same exuection plan?</description>
		<content:encoded><![CDATA[<p>Gali, I read in msdn forums that Bookmark Lookup(SQL 2000 or before)=Clustered Index seek (SQL 2005 RTM &amp; SP1) = Key Lookup (SQL 2005 SP2 &amp; later)..then how come we have both Key Lookup &amp; Clustered Index Seek in the same exuection plan?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Recent Links Tagged With "cardinality" - JabberTags</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-115</link>
		<dc:creator>Recent Links Tagged With "cardinality" - JabberTags</dc:creator>
		<pubDate>Thu, 16 Apr 2009 17:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-115</guid>
		<description>[...] public links &gt;&gt; cardinality   An example exec plan Saved by warnerbrosrecords on Sat 28-3-2009   Feature Models and Features - What’s this? Saved by [...]</description>
		<content:encoded><![CDATA[<p>[...] public links &gt;&gt; cardinality   An example exec plan Saved by warnerbrosrecords on Sat 28-3-2009   Feature Models and Features &#8211; What’s this? Saved by [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaiden</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-114</link>
		<dc:creator>Jaiden</dc:creator>
		<pubDate>Thu, 27 Nov 2008 08:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-114</guid>
		<description>This is good news, I</description>
		<content:encoded><![CDATA[<p>This is good news, I</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-113</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Wed, 03 Sep 2008 07:38:15 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-113</guid>
		<description>Hehe. That query comes straight out of the Adventureworks database. It wasn&#039;t an example of a good or a bad query, it was an example of how to read an execution plan.

The key lookup&#039;s rows couldn&#039;t be reduced in this case, because the column EndDate isn&#039;t in the nonclustered index, so the key lookup has to be done before the filter on EndDate (in either the original or the revised form) can be applied.

As for functions in a where clause - http://sqlinthewild.co.za/index.php/2007/07/19/functions-in-a-where-clause/</description>
		<content:encoded><![CDATA[<p>Hehe. That query comes straight out of the Adventureworks database. It wasn&#8217;t an example of a good or a bad query, it was an example of how to read an execution plan.</p>
<p>The key lookup&#8217;s rows couldn&#8217;t be reduced in this case, because the column EndDate isn&#8217;t in the nonclustered index, so the key lookup has to be done before the filter on EndDate (in either the original or the revised form) can be applied.</p>
<p>As for functions in a where clause &#8211; <a href="http://sqlinthewild.co.za/index.php/2007/07/19/functions-in-a-where-clause/" rel="nofollow">http://sqlinthewild.co.za/index.php/2007/07/19/functions-in-a-where-clause/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Lee</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-112</link>
		<dc:creator>Ken Lee</dc:creator>
		<pubDate>Wed, 03 Sep 2008 01:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-112</guid>
		<description>If the key lookup returned a huge number of rows the cost can also be reduced by rewriting the filter: &quot;&#039;2004-01-01 00:00:00.000&#039;&lt;=isnull(b.EndDate,&#039;2004-01-01 00:00:00.000&#039;)&quot;
as: &quot;(&#039;2004-01-01 00:00:00.000&#039;&lt;=b.EndDate or b.EndDate is null)&quot;
because isnull is a function that will be executed for every row in the index and the second will only select the rows that are true.
Unless your example is for bad where clauses, it is a good practice NEVER to put functions in where clauses.</description>
		<content:encoded><![CDATA[<p>If the key lookup returned a huge number of rows the cost can also be reduced by rewriting the filter: &#8220;&#8217;2004-01-01 00:00:00.000&#8242;&lt;=isnull(b.EndDate,&#8217;2004-01-01 00:00:00.000&#8242;)&#8221;<br />
as: &#8220;(&#8217;2004-01-01 00:00:00.000&#8242;&lt;=b.EndDate or b.EndDate is null)&#8221;<br />
because isnull is a function that will be executed for every row in the index and the second will only select the rows that are true.<br />
Unless your example is for bad where clauses, it is a good practice NEVER to put functions in where clauses.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ananth Ramasamy Meenachi</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/28/an-example-exec-plan/comment-page-1/#comment-111</link>
		<dc:creator>Ananth Ramasamy Meenachi</dc:creator>
		<pubDate>Mon, 01 Sep 2008 04:51:31 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=86#comment-111</guid>
		<description>A fantastic blog - &quot;How to glean interesting things from execution plan ?&quot;</description>
		<content:encoded><![CDATA[<p>A fantastic blog &#8211; &#8220;How to glean interesting things from execution plan ?&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

