<?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: Turning a Scan into a Seek With A Pointless Predicate	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/</link>
	<description></description>
	<lastBuildDate>Thu, 23 Nov 2017 13:28:23 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>
		By: Athul Jayachandran		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1939</link>

		<dc:creator><![CDATA[Athul Jayachandran]]></dc:creator>
		<pubDate>Thu, 23 Nov 2017 13:28:23 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1939</guid>

					<description><![CDATA[Thank you Rob for this, I am new to SQL server and this post helped me get rid of the seek/scan myth associated with indexes.  Most people are stuck on somehow achieving a seek, while a scan would give the exact same performance. 

Regards,
Athul]]></description>
			<content:encoded><![CDATA[<p>Thank you Rob for this, I am new to SQL server and this post helped me get rid of the seek/scan myth associated with indexes.  Most people are stuck on somehow achieving a seek, while a scan would give the exact same performance. </p>
<p>Regards,<br />
Athul</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1938</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Mon, 09 Mar 2015 12:02:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1938</guid>

					<description><![CDATA[Hi Sachin,
I&#039;m sorry, but you&#039;re somewhat wrong.
A Scan starts at the beginning of the index (or at the end of it&#039;s going backwards) to look for matches. It stops when it stops being asked for more records, or when it has looked through the index. A Seek starts at a particular position and then scans through a particular range. It also stops when it stops being asked for more records, or if the range it is looking through is done. 
While the range of a Seek might be smaller than the whole index, it might not be.
Also - in your post you say that a Clustered Index Scan is better than an Index Scan. That&#039;s almost never true. You also say that a Table Scan is the worst, but that is also very contentious.
Your post talks about the number of rows that satisfy the Predicate. You actually mean the Seek Predicate. As I showed in this post, if the Seek Predicate satisfies just about every row, then the Seek becomes worse than the Scan, which is hidden by the selectivity of the Predicate.
I feel like your comment is just trying to lure people to your website - and I will remove the link soon as I don&#039;t consider your website is helpful, and is even wrong in some situations.
Rob]]></description>
			<content:encoded><![CDATA[<p>Hi Sachin,<br />
I&#8217;m sorry, but you&#8217;re somewhat wrong.<br />
A Scan starts at the beginning of the index (or at the end of it&#8217;s going backwards) to look for matches. It stops when it stops being asked for more records, or when it has looked through the index. A Seek starts at a particular position and then scans through a particular range. It also stops when it stops being asked for more records, or if the range it is looking through is done.<br />
While the range of a Seek might be smaller than the whole index, it might not be.<br />
Also &#8211; in your post you say that a Clustered Index Scan is better than an Index Scan. That&#8217;s almost never true. You also say that a Table Scan is the worst, but that is also very contentious.<br />
Your post talks about the number of rows that satisfy the Predicate. You actually mean the Seek Predicate. As I showed in this post, if the Seek Predicate satisfies just about every row, then the Seek becomes worse than the Scan, which is hidden by the selectivity of the Predicate.<br />
I feel like your comment is just trying to lure people to your website &#8211; and I will remove the link soon as I don&#8217;t consider your website is helpful, and is even wrong in some situations.<br />
Rob</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sachin Dhir		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1937</link>

		<dc:creator><![CDATA[Sachin Dhir]]></dc:creator>
		<pubDate>Mon, 09 Mar 2015 11:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1937</guid>

					<description><![CDATA[Visit below link for more details on Scan Vs Seek

Scan indicates reading the whole of the index/table looking for matches – the time this takes is proportional to the size of the index.

Seek, on the other hand, indicates b-tree structure of the index to seek directly to matching records – time taken is only proportional to the number of matching records.

technowide.net/2015/02/18/move-scan-seek/]]></description>
			<content:encoded><![CDATA[<p>Visit below link for more details on Scan Vs Seek</p>
<p>Scan indicates reading the whole of the index/table looking for matches – the time this takes is proportional to the size of the index.</p>
<p>Seek, on the other hand, indicates b-tree structure of the index to seek directly to matching records – time taken is only proportional to the number of matching records.</p>
<p>technowide.net/2015/02/18/move-scan-seek/</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1936</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Wed, 14 Aug 2013 00:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1936</guid>

					<description><![CDATA[I point out that it&#039;s a Seek if there&#039;s a predicate being used as a Seek Predicate, which essentially the same sentiment. The Seek Predicate can be used to find the start of the RangeScan and then when to stop, while the Predicate is the &#034;check&#034; that is applied to every row in the Range. The Seek Predicate is applied to every row in the Range too, but the reaction of &#034;predicate not satisfied&#034; is to mark the end of the Range (thereby stopping the RangeScan).]]></description>
			<content:encoded><![CDATA[<p>I point out that it&#8217;s a Seek if there&#8217;s a predicate being used as a Seek Predicate, which essentially the same sentiment. The Seek Predicate can be used to find the start of the RangeScan and then when to stop, while the Predicate is the &quot;check&quot; that is applied to every row in the Range. The Seek Predicate is applied to every row in the Range too, but the reaction of &quot;predicate not satisfied&quot; is to mark the end of the Range (thereby stopping the RangeScan).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kalen Delaney		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1935</link>

		<dc:creator><![CDATA[Kalen Delaney]]></dc:creator>
		<pubDate>Tue, 13 Aug 2013 17:39:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1935</guid>

					<description><![CDATA[I was just linking around to some of your related posts, and found that you have an example almost exactly like mine in this post: 
&lt;a href=&quot;http://blogs.lobsterpot.com.au/2011/05/25/covering-index-because-its-covering-up-the-truth/&quot; rel=&quot;nofollow ugc&quot;&gt;http://sqlblog.com/blogs/rob_farley/archive/2011/05/25/covering-index-because-it-s-covering-up-the-truth.aspx&lt;/a&gt;
select * 
from Production.Product 
where ProductID &#060; 999999999; 
I basically explain it like this: There are only 2 operations that can be used on indexes: seeks and scans. And a scan is only used when the optimizer is absolutely sure it will have to look at every single row. And if it can&#039;t be sure it&#039;s a scan, the plan will say seek. Even if it&#039;s a whole lot of rows ...]]></description>
			<content:encoded><![CDATA[<p>I was just linking around to some of your related posts, and found that you have an example almost exactly like mine in this post:<br />
<a href="http://blogs.lobsterpot.com.au/2011/05/25/covering-index-because-its-covering-up-the-truth/" rel="nofollow ugc">http://sqlblog.com/blogs/rob_farley/archive/2011/05/25/covering-index-because-it-s-covering-up-the-truth.aspx</a><br />
select *<br />
from Production.Product<br />
where ProductID &lt; 999999999;<br />
I basically explain it like this: There are only 2 operations that can be used on indexes: seeks and scans. And a scan is only used when the optimizer is absolutely sure it will have to look at every single row. And if it can&#8217;t be sure it&#8217;s a scan, the plan will say seek. Even if it&#8217;s a whole lot of rows &#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1934</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Tue, 13 Aug 2013 17:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1934</guid>

					<description><![CDATA[I have other posts that relate to this as well, such as the one called &#034;Covering Schmuvvering&#034;, one on &#034;Probe Residual when you have a Hash Match&#034; (not actually about airport security).]]></description>
			<content:encoded><![CDATA[<p>I have other posts that relate to this as well, such as the one called &quot;Covering Schmuvvering&quot;, one on &quot;Probe Residual when you have a Hash Match&quot; (not actually about airport security).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1933</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Tue, 13 Aug 2013 17:24:02 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1933</guid>

					<description><![CDATA[Sounds good, Kalen. I find so many people fail to appreciate the residual Predicate&#039;s effect on a Seek operation, when the Seek Predicate is not selective enough. I feel like it turns up in almost every tuning exercise, and yet so many people miss it.
I love OPTION (QUERYTRACEON 9130) for giving a better indication about what&#039;s happening. :)
Rob]]></description>
			<content:encoded><![CDATA[<p>Sounds good, Kalen. I find so many people fail to appreciate the residual Predicate&#8217;s effect on a Seek operation, when the Seek Predicate is not selective enough. I feel like it turns up in almost every tuning exercise, and yet so many people miss it.<br />
I love OPTION (QUERYTRACEON 9130) for giving a better indication about what&#8217;s happening. 🙂<br />
Rob</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kalen Delaney		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1932</link>

		<dc:creator><![CDATA[Kalen Delaney]]></dc:creator>
		<pubDate>Tue, 13 Aug 2013 17:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1932</guid>

					<description><![CDATA[Hi Rob
I just found this post today... 
I have a really simple demo in my 5-day internals class where I show a plan that says it&#039;s doing a seek, but it actually looking at every single row in the table. So I stress to my students that just because the plan says &#039;seek&#039;, doesn&#039;t always means it&#039;s a great (or fast) plan. You have to look at rowcounts and costs also.
Thanks
Kalen]]></description>
			<content:encoded><![CDATA[<p>Hi Rob<br />
I just found this post today&#8230;<br />
I have a really simple demo in my 5-day internals class where I show a plan that says it&#8217;s doing a seek, but it actually looking at every single row in the table. So I stress to my students that just because the plan says &#8216;seek&#8217;, doesn&#8217;t always means it&#8217;s a great (or fast) plan. You have to look at rowcounts and costs also.<br />
Thanks<br />
Kalen</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: AaronBertrand		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1931</link>

		<dc:creator><![CDATA[AaronBertrand]]></dc:creator>
		<pubDate>Thu, 26 May 2011 16:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1931</guid>

					<description><![CDATA[Right-click the plan diagram and select &#034;Full Object Names&#034; :-)]]></description>
			<content:encoded><![CDATA[<p>Right-click the plan diagram and select &quot;Full Object Names&quot; 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/25/turning-a-scan-into-a-seek-with-a-pointless-predicate/#comment-1930</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Wed, 25 May 2011 16:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2961#comment-1930</guid>

					<description><![CDATA[Plan Explorer still seems to cut that one off - although it does show a bit more. The tooltip shows the whole name in both SSMS and SSPE.
But yeah, I keep feeling tempted to use SSPE for these diagrams, if only because it has the rowcount shown clearly.]]></description>
			<content:encoded><![CDATA[<p>Plan Explorer still seems to cut that one off &#8211; although it does show a bit more. The tooltip shows the whole name in both SSMS and SSPE.<br />
But yeah, I keep feeling tempted to use SSPE for these diagrams, if only because it has the rowcount shown clearly.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
