<?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 &#8211; Query Optimization &#8211; Remove Bookmark Lookup &#8211; Remove RID Lookup &#8211; Remove Key Lookup &#8211; Part 2</title>
	<atom:link href="http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 26 May 2013 03:27:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #007 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-393518</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #007 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 15 Dec 2012 01:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-393518</guid>
		<description><![CDATA[[...] 1 &#124; Part 2 &#124; Part 3 &#124; Part [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 1 | Part 2 | Part 3 | Part [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Smith</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-391868</link>
		<dc:creator><![CDATA[John Smith]]></dc:creator>
		<pubDate>Wed, 12 Dec 2012 11:33:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-391868</guid>
		<description><![CDATA[My question is its write to make one of the above index when we are using 10+ columns in particular statement?]]></description>
		<content:encoded><![CDATA[<p>My question is its write to make one of the above index when we are using 10+ columns in particular statement?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Beginning New Weekly Series &#8211; Memory Lane &#8211; #002 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-371921</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Beginning New Weekly Series &#8211; Memory Lane &#8211; #002 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 10 Nov 2012 01:31:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-371921</guid>
		<description><![CDATA[[...] are very relevant articles on this subject: Article 1 &#124; Article 2 &#124; Article [...]]]></description>
		<content:encoded><![CDATA[<p>[...] are very relevant articles on this subject: Article 1 | Article 2 | Article [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: irena</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-288584</link>
		<dc:creator><![CDATA[irena]]></dc:creator>
		<pubDate>Fri, 25 May 2012 14:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-288584</guid>
		<description><![CDATA[I have one question is index size smaller in method 2?]]></description>
		<content:encoded><![CDATA[<p>I have one question is index size smaller in method 2?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Thomas</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-266608</link>
		<dc:creator><![CDATA[Stuart Thomas]]></dc:creator>
		<pubDate>Fri, 23 Mar 2012 11:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-266608</guid>
		<description><![CDATA[Hi,
This is an awesome article. I came across to search method of non-clustered index on Google and I find this article on top. I obtained exact needs in this and now soon, I will be practical. 
Thanks for providing such useful information.]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
This is an awesome article. I came across to search method of non-clustered index on Google and I find this article on top. I obtained exact needs in this and now soon, I will be practical.<br />
Thanks for providing such useful information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko Parkkola</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-70794</link>
		<dc:creator><![CDATA[Marko Parkkola]]></dc:creator>
		<pubDate>Fri, 14 May 2010 06:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-70794</guid>
		<description><![CDATA[Hi,

I&#039;m not sure if I understood correctly. Did you meant...

CREATE NONCLUSTERED INDEX IX_Foo ON FOO (bar) INCLUDE (baz)

...that is there now a nonclustered index created on &quot;baz&quot; column?

No, there isn&#039;t. Index is created only on &quot;bar&quot; column. It&#039;s just plain normal nonclustered index.

But the data that&#039;s in &quot;baz&quot; column is copied to TEMPDB and any read operation, that uses IX_Foo index, is done againts TEMPDB. If IX_Foo index is not used then the &quot;baz&quot; column is read from the actual data table.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m not sure if I understood correctly. Did you meant&#8230;</p>
<p>CREATE NONCLUSTERED INDEX IX_Foo ON FOO (bar) INCLUDE (baz)</p>
<p>&#8230;that is there now a nonclustered index created on &#8220;baz&#8221; column?</p>
<p>No, there isn&#8217;t. Index is created only on &#8220;bar&#8221; column. It&#8217;s just plain normal nonclustered index.</p>
<p>But the data that&#8217;s in &#8220;baz&#8221; column is copied to TEMPDB and any read operation, that uses IX_Foo index, is done againts TEMPDB. If IX_Foo index is not used then the &#8220;baz&#8221; column is read from the actual data table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaypal</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-70713</link>
		<dc:creator><![CDATA[Jaypal]]></dc:creator>
		<pubDate>Thu, 13 May 2010 13:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-70713</guid>
		<description><![CDATA[I wanted to ask one question that is does the Include options to create covering index actually i.e. physically create non-clustered index on the column.]]></description>
		<content:encoded><![CDATA[<p>I wanted to ask one question that is does the Include options to create covering index actually i.e. physically create non-clustered index on the column.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Four Posts on Removing the Bookmark Lookup – Key Lookup Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-70651</link>
		<dc:creator><![CDATA[SQL SERVER – Four Posts on Removing the Bookmark Lookup – Key Lookup Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Thu, 13 May 2010 01:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-70651</guid>
		<description><![CDATA[[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lo... [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lo&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Baltadonis</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-61724</link>
		<dc:creator><![CDATA[Paul Baltadonis]]></dc:creator>
		<pubDate>Wed, 24 Feb 2010 22:22:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-61724</guid>
		<description><![CDATA[I need some help....  I am not a DBA, and am just getting into this SQL thing.  I have a query established, but it is returning HTML characters in two columns.  How can you eliminate that inside of the query.  I have pasted the query below for your review.

SELECT vWorkOrderReportRandle.WOOID, vWorkOrderReportRandle.WODateScheduled, vWorkOrderReportRandle.EquipDesc, vWorkOrderReportRandle.WOStatusDesc, vWorkOrderReportRandle.Type, vWorkOrderReportRandle.WOProblem, vWorkOrderReportRandle.WORepairsRequired, vWorkOrderReportRandle.WOLaborHoursEst, vWorkOrderReportRandle.WOCostAct, vWorkOrderReportRandle.WOCostEst, vWorkOrderReportRandle.WOKit, vWorkOrderReportRandle.Initiator, vWorkOrderReportRandle.Assignee, vWorkOrderReportRandle.WOStatus, vWorkOrderReportRandle.Requestor, vWorkOrderReportRandle.FullPath
FROM HamptonMaintenance.dbo.vWorkOrderReportRandle vWorkOrderReportRandle]]></description>
		<content:encoded><![CDATA[<p>I need some help&#8230;.  I am not a DBA, and am just getting into this SQL thing.  I have a query established, but it is returning HTML characters in two columns.  How can you eliminate that inside of the query.  I have pasted the query below for your review.</p>
<p>SELECT vWorkOrderReportRandle.WOOID, vWorkOrderReportRandle.WODateScheduled, vWorkOrderReportRandle.EquipDesc, vWorkOrderReportRandle.WOStatusDesc, vWorkOrderReportRandle.Type, vWorkOrderReportRandle.WOProblem, vWorkOrderReportRandle.WORepairsRequired, vWorkOrderReportRandle.WOLaborHoursEst, vWorkOrderReportRandle.WOCostAct, vWorkOrderReportRandle.WOCostEst, vWorkOrderReportRandle.WOKit, vWorkOrderReportRandle.Initiator, vWorkOrderReportRandle.Assignee, vWorkOrderReportRandle.WOStatus, vWorkOrderReportRandle.Requestor, vWorkOrderReportRandle.FullPath<br />
FROM HamptonMaintenance.dbo.vWorkOrderReportRandle vWorkOrderReportRandle</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boy95</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56933</link>
		<dc:creator><![CDATA[Boy95]]></dc:creator>
		<pubDate>Fri, 23 Oct 2009 11:17:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56933</guid>
		<description><![CDATA[In addition, the applicant participates in multiple     national, state, and local associations to gather and share best practices     and learning. ,]]></description>
		<content:encoded><![CDATA[<p>In addition, the applicant participates in multiple     national, state, and local associations to gather and share best practices     and learning. ,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56601</link>
		<dc:creator><![CDATA[SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Mon, 12 Oct 2009 02:50:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56601</guid>
		<description><![CDATA[[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lo... [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lo&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup – Part 3 Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56600</link>
		<dc:creator><![CDATA[SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lookup – Part 3 Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Mon, 12 Oct 2009 02:50:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56600</guid>
		<description><![CDATA[[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lo... [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Query Optimization – Remove Bookmark Lookup – Remove RID Lookup – Remove Key Lo&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patricio</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56538</link>
		<dc:creator><![CDATA[Patricio]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 14:50:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56538</guid>
		<description><![CDATA[Hi Pinal,

Great post, but how do i remove Bookmark lookup (table with clustered index) where it is not possible create index with include columns. Or is it possible?

thanks!!]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Great post, but how do i remove Bookmark lookup (table with clustered index) where it is not possible create index with include columns. Or is it possible?</p>
<p>thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krunal</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56537</link>
		<dc:creator><![CDATA[Krunal]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 13:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56537</guid>
		<description><![CDATA[@Rajendra

What I understand upto reading 1 time only is

select distinct month from the year 2009 (january to this month)

and then use CURSOR...

I think this might help you..]]></description>
		<content:encoded><![CDATA[<p>@Rajendra</p>
<p>What I understand upto reading 1 time only is</p>
<p>select distinct month from the year 2009 (january to this month)</p>
<p>and then use CURSOR&#8230;</p>
<p>I think this might help you..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajendra</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56535</link>
		<dc:creator><![CDATA[rajendra]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 11:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56535</guid>
		<description><![CDATA[hi every one,
I need a query, and the requirement is--

Count the number of customers that shopped 10 months ago, but have not returned since.
(example: For October , count total number of customers that shopped in January.  Then count the number of those customers that DID not return Feb-Sept. )

My table name is customerInvoices, consists invoiceId, customerId and invoiceDate.

I wrote the fallowing query for the october month( means the customer should have an invoice in january and he should not have any invoice in the next 8 months(feb-sep)).

-- To get lapsed customers of october
select month(GETDATE())AS [Month],count(ci.customerId) AS [Number of Lapsed customers] from CustomerInvoices ci
where YEAR(ci.invoiceDate)=2009
and month(ci.invoiceDate)=MONTH(DATEADD(month,-09,getdate()))
and customerID not in
(
	select customerID from customerInvoices
	where (invoiceDate)&gt; 
	(	CAST(
		(CAST
		(month(DATEADD(MONTH,-08,GETDATE())) AS CHAR(2))
		+&#039;-01-&#039;+
		CAST(YEAR(ci.invoiceDate) AS CHAR(4))) AS date)
	)	
	and (invoiceDate)&lt; 
	(
		CAST(
		(CAST
		(month(DATEADD(MONTH,-01,GETDATE())) AS CHAR(2))
		+&#039;-01-&#039;+
		CAST(YEAR(ci.invoiceDate) AS CHAR(4))) AS date)
	)	
)


It&#039;s working perfectly for the october month, but i want to display the result from january to october, how can i include other months also...

If anyone knows this plz help,
thank you.]]></description>
		<content:encoded><![CDATA[<p>hi every one,<br />
I need a query, and the requirement is&#8211;</p>
<p>Count the number of customers that shopped 10 months ago, but have not returned since.<br />
(example: For October , count total number of customers that shopped in January.  Then count the number of those customers that DID not return Feb-Sept. )</p>
<p>My table name is customerInvoices, consists invoiceId, customerId and invoiceDate.</p>
<p>I wrote the fallowing query for the october month( means the customer should have an invoice in january and he should not have any invoice in the next 8 months(feb-sep)).</p>
<p>&#8211; To get lapsed customers of october<br />
select month(GETDATE())AS [Month],count(ci.customerId) AS [Number of Lapsed customers] from CustomerInvoices ci<br />
where YEAR(ci.invoiceDate)=2009<br />
and month(ci.invoiceDate)=MONTH(DATEADD(month,-09,getdate()))<br />
and customerID not in<br />
(<br />
	select customerID from customerInvoices<br />
	where (invoiceDate)&gt;<br />
	(	CAST(<br />
		(CAST<br />
		(month(DATEADD(MONTH,-08,GETDATE())) AS CHAR(2))<br />
		+&#8217;-01-&#8217;+<br />
		CAST(YEAR(ci.invoiceDate) AS CHAR(4))) AS date)<br />
	)<br />
	and (invoiceDate)&lt;<br />
	(<br />
		CAST(<br />
		(CAST<br />
		(month(DATEADD(MONTH,-01,GETDATE())) AS CHAR(2))<br />
		+&#039;-01-&#039;+<br />
		CAST(YEAR(ci.invoiceDate) AS CHAR(4))) AS date)<br />
	)<br />
)</p>
<p>It&#039;s working perfectly for the october month, but i want to display the result from january to october, how can i include other months also&#8230;</p>
<p>If anyone knows this plz help,<br />
thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chintan Shah</title>
		<link>http://blog.sqlauthority.com/2009/10/08/sql-server-query-optimization-remove-bookmark-lookup-remove-rid-lookup-remove-key-lookup-part-2/#comment-56517</link>
		<dc:creator><![CDATA[Chintan Shah]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 06:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6967#comment-56517</guid>
		<description><![CDATA[Hi Pinal,

Is it good to create one of the above index when we are using 20+ columns in select statement?]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Is it good to create one of the above index when we are using 20+ columns in select statement?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
