<?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: Covering, schmuvvering – when a covering index is actually rubbish	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/</link>
	<description></description>
	<lastBuildDate>Mon, 14 Dec 2015 01:33:46 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1892</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Mon, 14 Dec 2015 01:33:46 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1892</guid>

					<description><![CDATA[The NC index is designed to be weak - that&#039;s why I had to use a hint to get it to be used in the first case. But the point about having an ineffective index holds. People frequently kill the impact of a composite index by using an inequality, or apply a function so the index key can&#039;t be used at all - and if there&#039;s a leading key which can be used, an Index Seek which produces a small number of rows is seen. It looks good, but isn&#039;t.
But the impact of this can be seen using trace flag 9130, or now with later service packs on 2012. &lt;a href=&quot;http://blogs.lobsterpot.com.au/2015/12/12/a-new-superpower-for-sql-query-tuners-number-of-rows-read/&quot; rel=&quot;nofollow ugc&quot;&gt;http://sqlblog.com/blogs/rob_farley/archive/2015/12/12/a-new-superpower-for-sql-query-tuners-number-of-rows-read.aspx&lt;/a&gt;]]></description>
			<content:encoded><![CDATA[<p>The NC index is designed to be weak &#8211; that&#8217;s why I had to use a hint to get it to be used in the first case. But the point about having an ineffective index holds. People frequently kill the impact of a composite index by using an inequality, or apply a function so the index key can&#8217;t be used at all &#8211; and if there&#8217;s a leading key which can be used, an Index Seek which produces a small number of rows is seen. It looks good, but isn&#8217;t.<br />
But the impact of this can be seen using trace flag 9130, or now with later service packs on 2012. <a href="http://blogs.lobsterpot.com.au/2015/12/12/a-new-superpower-for-sql-query-tuners-number-of-rows-read/" rel="nofollow ugc">http://sqlblog.com/blogs/rob_farley/archive/2015/12/12/a-new-superpower-for-sql-query-tuners-number-of-rows-read.aspx</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Greg Low		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1891</link>

		<dc:creator><![CDATA[Greg Low]]></dc:creator>
		<pubDate>Mon, 14 Dec 2015 01:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1891</guid>

					<description><![CDATA[That NC index is a pretty weak index though. The index itself (on DaysToManufacture) isn&#039;t selective in the first place, regardless of whether or not the included columns make it cover the query.
I suppose the main issue is how well the QO discerns what&#039;s going on.]]></description>
			<content:encoded><![CDATA[<p>That NC index is a pretty weak index though. The index itself (on DaysToManufacture) isn&#8217;t selective in the first place, regardless of whether or not the included columns make it cover the query.<br />
I suppose the main issue is how well the QO discerns what&#8217;s going on.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1890</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Wed, 03 Oct 2012 16:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1890</guid>

					<description><![CDATA[Can you send me an email with the execution plan in it? I&#039;m sure there must be something else going on, as I see little reason in what you&#039;ve written for it to scan rather than seek. You can reach me at hotmail.com, as rob_farley.]]></description>
			<content:encoded><![CDATA[<p>Can you send me an email with the execution plan in it? I&#8217;m sure there must be something else going on, as I see little reason in what you&#8217;ve written for it to scan rather than seek. You can reach me at hotmail.com, as rob_farley.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rajesh		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1889</link>

		<dc:creator><![CDATA[Rajesh]]></dc:creator>
		<pubDate>Wed, 03 Oct 2012 15:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1889</guid>

					<description><![CDATA[Hi Rob,
I have a table, having non cluster index say(id,date), but when I am running a query
select id,date from table where id = 1 and date = &#039;2010-09-09&#039;
its always performing index scan, while returning only one row..
so why this is happening, when my index is selective only one row itis returning, then why scan also it involvs 98 logical redas..
also this index is not unique, both id and date have duplicate values, but &#160;this combination of date and id has only single row.]]></description>
			<content:encoded><![CDATA[<p>Hi Rob,<br />
I have a table, having non cluster index say(id,date), but when I am running a query<br />
select id,date from table where id = 1 and date = &#8216;2010-09-09&#8217;<br />
its always performing index scan, while returning only one row..<br />
so why this is happening, when my index is selective only one row itis returning, then why scan also it involvs 98 logical redas..<br />
also this index is not unique, both id and date have duplicate values, but &nbsp;this combination of date and id has only single row.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1888</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Thu, 07 Jul 2011 15:14:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1888</guid>

					<description><![CDATA[Hi Phil,
There are plenty of situations where people try to force indexes to be used because they want a Seek that returns a single row, because they assume that it&#039;s an ideal operation. That&#039;s what I&#039;m trying to challenge.
Rob]]></description>
			<content:encoded><![CDATA[<p>Hi Phil,<br />
There are plenty of situations where people try to force indexes to be used because they want a Seek that returns a single row, because they assume that it&#8217;s an ideal operation. That&#8217;s what I&#8217;m trying to challenge.<br />
Rob</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Phil		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1887</link>

		<dc:creator><![CDATA[Phil]]></dc:creator>
		<pubDate>Thu, 07 Jul 2011 12:43:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1887</guid>

					<description><![CDATA[But you admit that you had to provide an index hint to get the optimiser to use this misleading index, so what exactly are we proving here? &#160;Yes, there are (artificcial) situations where a single-row seek can require more effort than is apparent at first glance, but since the optimiser doesn&#039;t actually choose such options unless you make it I&#039;m not sure how surprising the information is here?]]></description>
			<content:encoded><![CDATA[<p>But you admit that you had to provide an index hint to get the optimiser to use this misleading index, so what exactly are we proving here? &nbsp;Yes, there are (artificcial) situations where a single-row seek can require more effort than is apparent at first glance, but since the optimiser doesn&#8217;t actually choose such options unless you make it I&#8217;m not sure how surprising the information is here?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: gbn		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1886</link>

		<dc:creator><![CDATA[gbn]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 13:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1886</guid>

					<description><![CDATA[The optimiser has just found an index that matches roughly and decided to use it.
It isn&#039;t really covering for this query, more &#034;convenient&#034;.
So in that sense, yes, the seek is useless because it is a scan.]]></description>
			<content:encoded><![CDATA[<p>The optimiser has just found an index that matches roughly and decided to use it.<br />
It isn&#8217;t really covering for this query, more &quot;convenient&quot;.<br />
So in that sense, yes, the seek is useless because it is a scan.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1885</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 12:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1885</guid>

					<description><![CDATA[Hi gbn,
Yes, there are benefits to having the equality predicate&#039;s field as the leading key. But that&#039;s pretty much it. Even though the covering index looks good according to the plan, the fact that the Seek Predicate is so non-selective is a problem. I know there are better indexes available (the best being a filtered index), but I&#039;m showing that just because you have a Seek on a Covering Index, you don&#039;t necessarily have an effective index.
Rob]]></description>
			<content:encoded><![CDATA[<p>Hi gbn,<br />
Yes, there are benefits to having the equality predicate&#8217;s field as the leading key. But that&#8217;s pretty much it. Even though the covering index looks good according to the plan, the fact that the Seek Predicate is so non-selective is a problem. I know there are better indexes available (the best being a filtered index), but I&#8217;m showing that just because you have a Seek on a Covering Index, you don&#8217;t necessarily have an effective index.<br />
Rob</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: gbn		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1884</link>

		<dc:creator><![CDATA[gbn]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 10:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1884</guid>

					<description><![CDATA[What if the index matches all WHERE conditions?
CREATE INDEX rf_ix_Covering ON Production.Product (DaysToManufacture, ReorderPoint, Color) 
INCLUDE (Name, ProductNumber, Size) 
WITH (FILLFACTOR=30)
or this with equality column first?
CREATE INDEX rf_ix_Covering ON Production.Product(Color, DaysToManufacture, ReorderPoint) 
INCLUDE (Name, ProductNumber, Size) 
WITH (FILLFACTOR=30)
The index above isn&#039;t covering in the sense that I understand because filter/key columns don&#039;t match the query. You are filtering unsorted INCLUDE columns]]></description>
			<content:encoded><![CDATA[<p>What if the index matches all WHERE conditions?<br />
CREATE INDEX rf_ix_Covering ON Production.Product (DaysToManufacture, ReorderPoint, Color)<br />
INCLUDE (Name, ProductNumber, Size)<br />
WITH (FILLFACTOR=30)<br />
or this with equality column first?<br />
CREATE INDEX rf_ix_Covering ON Production.Product(Color, DaysToManufacture, ReorderPoint)<br />
INCLUDE (Name, ProductNumber, Size)<br />
WITH (FILLFACTOR=30)<br />
The index above isn&#8217;t covering in the sense that I understand because filter/key columns don&#8217;t match the query. You are filtering unsorted INCLUDE columns</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/05/19/covering-schmuvvering-when-a-covering-index-is-actually-rubbish/#comment-1883</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Mon, 23 May 2011 13:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2939#comment-1883</guid>

					<description><![CDATA[Oh, and Andrew - the other fillfactors were 100%, but as mentioned in the post, the filter index had only one row, so fillfactor isn&#039;t going to be particularly relevant. I did admit to &#034;a bit of trickery&#034;, after all (but only to demonstrate a valid point).]]></description>
			<content:encoded><![CDATA[<p>Oh, and Andrew &#8211; the other fillfactors were 100%, but as mentioned in the post, the filter index had only one row, so fillfactor isn&#8217;t going to be particularly relevant. I did admit to &quot;a bit of trickery&quot;, after all (but only to demonstrate a valid point).</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
