<?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: Filtered Indexes Work-Around</title>
	<atom:link href="http://sqlfool.com/2010/02/filtered-indexes-work-around/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/</link>
	<description>Self-Professed SQL Scripting Junkie!</description>
	<lastBuildDate>Fri, 04 May 2012 08:30:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Larry Leonard</title>
		<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/comment-page-1/#comment-5232</link>
		<dc:creator>Larry Leonard</dc:creator>
		<pubDate>Wed, 25 Aug 2010 15:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://sqlfool.com/?p=1307#comment-5232</guid>
		<description>Hi Michelle - 

Is there a workaround for this issue that doesn&#039;t require me to tell my application developers they have to change all their code?   ;)   Something I could do at the index level?  Thanks.</description>
		<content:encoded><![CDATA[<p>Hi Michelle &#8211; </p>
<p>Is there a workaround for this issue that doesn&#8217;t require me to tell my application developers they have to change all their code?   <img src='http://sqlfool.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />    Something I could do at the index level?  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry</title>
		<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/comment-page-1/#comment-5061</link>
		<dc:creator>Jerry</dc:creator>
		<pubDate>Thu, 04 Feb 2010 08:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlfool.com/?p=1307#comment-5061</guid>
		<description>Ok, that makes sense.  But just for the record, I received the error today using a join hint in the OPTION statement.</description>
		<content:encoded><![CDATA[<p>Ok, that makes sense.  But just for the record, I received the error today using a join hint in the OPTION statement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michelle Ufford</title>
		<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/comment-page-1/#comment-5059</link>
		<dc:creator>Michelle Ufford</dc:creator>
		<pubDate>Wed, 03 Feb 2010 22:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://sqlfool.com/?p=1307#comment-5059</guid>
		<description>Hi Alex,

Yes, that works too!  I&#039;ll edit my post with your suggestion too.  Thank you.  :)

Michelle</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>Yes, that works too!  I&#8217;ll edit my post with your suggestion too.  Thank you.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Michelle</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michelle Ufford</title>
		<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/comment-page-1/#comment-5058</link>
		<dc:creator>Michelle Ufford</dc:creator>
		<pubDate>Wed, 03 Feb 2010 22:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://sqlfool.com/?p=1307#comment-5058</guid>
		<description>Hi Jerry,

I actually mispoke (mistyped?) a little.  I thought the error message was returned that way because it was called via stored proc, but really you would get the same error message if you just try to force the hint in an ad-hoc query, too.  

You receive the error message because Query Optimizer, sometimes correctly and sometimes incorrectly, perceives that it will be unable to fulfill the request using the index you specify.  The only case I&#039;ve ever seen this in (so far) has been a filtered index.  Hopefully that helps, and good luck!  :)

Michelle</description>
		<content:encoded><![CDATA[<p>Hi Jerry,</p>
<p>I actually mispoke (mistyped?) a little.  I thought the error message was returned that way because it was called via stored proc, but really you would get the same error message if you just try to force the hint in an ad-hoc query, too.  </p>
<p>You receive the error message because Query Optimizer, sometimes correctly and sometimes incorrectly, perceives that it will be unable to fulfill the request using the index you specify.  The only case I&#8217;ve ever seen this in (so far) has been a filtered index.  Hopefully that helps, and good luck!  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Michelle</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Kuznetsov</title>
		<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/comment-page-1/#comment-5057</link>
		<dc:creator>Alex Kuznetsov</dc:creator>
		<pubDate>Wed, 03 Feb 2010 22:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://sqlfool.com/?p=1307#comment-5057</guid>
		<description>Hi Michelle,

I think that if you explicitly tell the optimizer that your parameter fits into the filter. Instead of:

SELECT DISTINCT myData
FROM dbo.filteredIndexTest
WHERE myDate &gt;= @myDate1;

let us try this:

SELECT DISTINCT myData
FROM dbo.filteredIndexTest
WHERE myDate &gt;= @myDate1
AND myDate&gt;&#039;theThresholdInMyFilteredIndex&#039;

What do you think, Michelle?</description>
		<content:encoded><![CDATA[<p>Hi Michelle,</p>
<p>I think that if you explicitly tell the optimizer that your parameter fits into the filter. Instead of:</p>
<p>SELECT DISTINCT myData<br />
FROM dbo.filteredIndexTest<br />
WHERE myDate &gt;= @myDate1;</p>
<p>let us try this:</p>
<p>SELECT DISTINCT myData<br />
FROM dbo.filteredIndexTest<br />
WHERE myDate &gt;= @myDate1<br />
AND myDate&gt;&#8217;theThresholdInMyFilteredIndex&#8217;</p>
<p>What do you think, Michelle?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry</title>
		<link>http://sqlfool.com/2010/02/filtered-indexes-work-around/comment-page-1/#comment-5056</link>
		<dc:creator>Jerry</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:53:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlfool.com/?p=1307#comment-5056</guid>
		<description>Ok, in a freakish coincidence, I got the same error today for the very first time.  Wow.  Your post concentrated on why the sproc was not using the filtered index, and how to get it to use the index, which, of course, is valuable information.

However, I am much more interested in what causes this error in the first place. You state, &quot;...since this was a stored procedure, I was receiving the following error message...&quot;  implying this is due to sprocs.  However, we&#039;ve been using index hints in sprocs for years, and have never received this error. I am curious why I am getting it now all of a sudden on one specific sproc.  Do you or any of your readers have insight on that?

Thanks!</description>
		<content:encoded><![CDATA[<p>Ok, in a freakish coincidence, I got the same error today for the very first time.  Wow.  Your post concentrated on why the sproc was not using the filtered index, and how to get it to use the index, which, of course, is valuable information.</p>
<p>However, I am much more interested in what causes this error in the first place. You state, &#8220;&#8230;since this was a stored procedure, I was receiving the following error message&#8230;&#8221;  implying this is due to sprocs.  However, we&#8217;ve been using index hints in sprocs for years, and have never received this error. I am curious why I am getting it now all of a sudden on one specific sproc.  Do you or any of your readers have insight on that?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

