<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx</link><description>A few days ago, Sandra Mueller (twitter | blog) asked a question using twitter’s #sqlhelp hash tag: “Might SQL Server retrieve (out-of-row) LOB data from a table, even if the column isn’t referenced in the query?” Leaving aside trivial cases (like selecting</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31566</link><pubDate>Mon, 13 Dec 2010 15:55:50 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31566</guid><dc:creator>Matt Whitfield</dc:creator><description>&lt;p&gt;Sir, once again I am in awe. Brilliant stuff.&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31567</link><pubDate>Mon, 13 Dec 2010 16:05:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31567</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Wow, that was fast Matt! &amp;nbsp;Thank you :)&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31570</link><pubDate>Mon, 13 Dec 2010 17:49:23 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31570</guid><dc:creator>Brad Schulz</dc:creator><description>&lt;p&gt;I second Matt's comment... Excellent.&lt;/p&gt;
&lt;p&gt;Always a joy to read your posts... I always learn something.&lt;/p&gt;
&lt;p&gt;--Brad&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31572</link><pubDate>Mon, 13 Dec 2010 18:07:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31572</guid><dc:creator>hallidayd</dc:creator><description>&lt;p&gt;Hey Paul&lt;/p&gt;
&lt;p&gt;First NCI is supposed to be non-unique right? Looks identical to the second NCI...&lt;/p&gt;
&lt;p&gt;Otherwise, tip top stuff&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Dan&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31580</link><pubDate>Mon, 13 Dec 2010 21:44:40 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31580</guid><dc:creator>Chris Howarth</dc:creator><description>&lt;p&gt;Great post Paul, as always.&lt;/p&gt;
&lt;p&gt;Just curious - how do you come about this information?&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31590</link><pubDate>Tue, 14 Dec 2010 02:27:02 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31590</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Dan,&lt;/p&gt;
&lt;p&gt;Yes, you're absolutely right. &amp;nbsp;Well spotted! &amp;nbsp;I've updated the name and definition of the index used in test 2.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31592</link><pubDate>Tue, 14 Dec 2010 02:45:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31592</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;That's a difficult question to answer, but generally it comes from digging into execution plans, and running experiments to try to understand why SQL Server does what it does.&lt;/p&gt;
&lt;p&gt;The information on Split/Sort/Collapse comes from Conor Cunningham's excellent chapter in SQL Server 2008 Internals.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31593</link><pubDate>Tue, 14 Dec 2010 02:51:05 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31593</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Brad,&lt;/p&gt;
&lt;p&gt;Thanks - and right back at you :)&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31602</link><pubDate>Tue, 14 Dec 2010 07:30:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31602</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hi Paul &lt;/p&gt;
&lt;p&gt;If we create a NCI on the LOB column, SQL Server creates copy of that index (thanks to Paul Randal) thus it takes time .. Usually I am not creating an index on LOB nor include them, as performance gain is too little... Little bit OT,sorry&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://dimantdatabasesolutions.blogspot.com/2010/11/blobs-and-covering-indexes.html"&gt;http://dimantdatabasesolutions.blogspot.com/2010/11/blobs-and-covering-indexes.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31604</link><pubDate>Tue, 14 Dec 2010 07:45:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31604</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hi Uri,&lt;/p&gt;
&lt;p&gt;Yes, including large LOB columns in non-clustered index is perhaps a dubious practice, and not something I can recall doing often myself.&lt;/p&gt;
&lt;p&gt;This post is less about LOBs, and more about included columns and unique indexes in general, but I take your point.&lt;/p&gt;
&lt;p&gt;Thanks for taking the time to comment.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31972</link><pubDate>Sun, 26 Dec 2010 13:11:38 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31972</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm curious - in Test 1 - why does the clustered index have to be updated, when we're only updating some_value?&lt;/p&gt;
&lt;p&gt;An obvious answer, I'm sure - I just can't see it.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Chris.&lt;/p&gt;</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#31974</link><pubDate>Sun, 26 Dec 2010 18:31:45 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31974</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hi Chris,&lt;/p&gt;
&lt;p&gt;The clustered index *keys* aren't being updated; the clustered index is being used to locate the row to change. &amp;nbsp;Make sense?&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#33652</link><pubDate>Mon, 21 Feb 2011 12:03:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:33652</guid><dc:creator>Paul Randal</dc:creator><description>&lt;p&gt;Excellent post Paul!&lt;/p&gt;</description></item><item><title>re: Beware Sneaky Reads with Unique Indexes</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#33657</link><pubDate>Mon, 21 Feb 2011 13:14:46 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:33657</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Cheers, Paul :)&lt;/p&gt;
</description></item><item><title>Enforcing Uniqueness for Performance</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/12/14/beware-sneaky-reads-with-unique-indexes.aspx#37379</link><pubDate>Thu, 28 Jul 2011 15:38:44 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37379</guid><dc:creator>Paul White: Page Free Space</dc:creator><description>&lt;p&gt;Just a quick blog entry today, leading up to the next one (which is going to be *awesome*).&amp;amp;#160; A little&lt;/p&gt;
</description></item></channel></rss>