<?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>Geek City: How SQL Server Detects the Correct Versioned Rows</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/04/03/how-sql-server-detects-the-correct-versioned-rows.aspx</link><description>Here is a question I just received from the feedback page on my web site: I have finished the book &amp;lt;the storage engine&amp;gt; and like it very much. I am now reading &amp;lt;query tuning and optimization&amp;gt; I know in the READ COMMITTED SNAPSHOT isolation,</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Geek City: How SQL Server Detects the Correct Versioned Rows</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/04/03/how-sql-server-detects-the-correct-versioned-rows.aspx#6037</link><pubDate>Thu, 03 Apr 2008 21:26:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6037</guid><dc:creator>Michael Zilberstein</dc:creator><description>&lt;p&gt;So this should work for indexes too? If query uses covering index, it may never come to data (or clustered index if the one exists) leaf level. So indexes should also keep additional 14 bytes. But for index row size which is usually small, additional 14 bytes per row can have pretty serious negative performance impact. Does it really work this way or some optimization exists that I can't think about?&lt;/p&gt;
</description></item><item><title>re: Geek City: How SQL Server Detects the Correct Versioned Rows</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/04/03/how-sql-server-detects-the-correct-versioned-rows.aspx#6041</link><pubDate>Fri, 04 Apr 2008 03:33:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6041</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Hi Michael&lt;/p&gt;
&lt;p&gt;Index rows do get versioned, so they need to keep the 14 bytes also. &lt;/p&gt;
&lt;p&gt;I just ran a test on a table with a nonclustered index of type money, so it was 8 bytes, plus about 8 bytes of overhead in each row before snapshot isolation. I looked at an index page with DBCC IND and there were 426 rows on a page.&lt;/p&gt;
&lt;p&gt;I then enabled the db for snapshot, and updated the money column for all rows in the table. When I looked at the index page again, there were now only 213 rows on the page, and each row was marked as containing VERSIONING_INFO. So yes, this can have a big impact on space usage, and thus on performance. &lt;/p&gt;
&lt;p&gt;You didn't think you got snapshot isolation and non-blocking reads for free, did you? There are costs associated with snapshot isolation, in addition to this one.&lt;/p&gt;
&lt;p&gt;~Kalen&lt;/p&gt;
</description></item><item><title>re: Geek City: How SQL Server Detects the Correct Versioned Rows</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/04/03/how-sql-server-detects-the-correct-versioned-rows.aspx#6100</link><pubDate>Mon, 07 Apr 2008 02:09:45 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6100</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Thank you very much for responding so fast, it helps!&lt;/p&gt;
</description></item><item><title>re: Geek City: How SQL Server Detects the Correct Versioned Rows</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/04/03/how-sql-server-detects-the-correct-versioned-rows.aspx#6101</link><pubDate>Mon, 07 Apr 2008 03:08:12 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6101</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Oops, I need a correction.... I used DBCC IND to find a page number, and then DBCC PAGE to look at the page.&lt;/p&gt;
</description></item></channel></rss>