<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>SQL Server fragmentation</title><link>http://blogs.msdn.com/b/anthonybloesch/archive/2008/12/18/sql-server-fragmentation.aspx</link><description>We have recently been looking at database fragmentation for real usage of the "Oslo" repository. However, since database fragmentation is a major cause of poor performance I thought a discussion of how to minimize and deal with database fragmentation</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: SQL Server fragmentation</title><link>http://blogs.msdn.com/b/anthonybloesch/archive/2008/12/18/sql-server-fragmentation.aspx#9242881</link><pubDate>Sat, 20 Dec 2008 00:21:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9242881</guid><dc:creator>Anthony Bloesch</dc:creator><description>&lt;p&gt;I know the COMBs approach has a following but I believe UuidCreateSequential is a more solid approach especially 6 years after the original article. UuidCreateSequential has great properties and conforms to the UUID standard &lt;a rel="nofollow" target="_new" href="http://www.itu.int/ITU-T/studygroups/com17/oid.html"&gt;http://www.itu.int/ITU-T/studygroups/com17/oid.html&lt;/a&gt;. If you like the essential idea of COMBs the standard defines how to do it so you have a low chance of UUIDs colliding.&lt;/p&gt;
&lt;p&gt;Jimmy Nilsson is right to urge caution around bechmarks. The best approach for performance critical code is to implement it and test with realistic workloads. In my insert tests ints and bigints have 5 times the throughput of sequential GUIDs and sequential GUIDs have 50 times the throughput of nonsequential GUIDs. In my lookup tests ints and bigints have 20% better throughput than sequential GUIDs and sequential GUIDs have 50% better throughput than nonsequential GUIDs. Because sequential GUIDs compress well you also get an added boost by turning on row compression.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9242881" width="1" height="1"&gt;</description></item><item><title>re: SQL Server fragmentation</title><link>http://blogs.msdn.com/b/anthonybloesch/archive/2008/12/18/sql-server-fragmentation.aspx#9242711</link><pubDate>Fri, 19 Dec 2008 22:35:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9242711</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;What are your thoughts on COMBS in Jimmy Nilsson's article &amp;quot;The Cost of GUIDs as Primary Keys&amp;quot;?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.informit.com/articles/article.aspx?p=25862&amp;amp;seqNum=7"&gt;http://www.informit.com/articles/article.aspx?p=25862&amp;amp;seqNum=7&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9242711" width="1" height="1"&gt;</description></item><item><title>re: SQL Server fragmentation</title><link>http://blogs.msdn.com/b/anthonybloesch/archive/2008/12/18/sql-server-fragmentation.aspx#9242445</link><pubDate>Fri, 19 Dec 2008 20:08:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9242445</guid><dc:creator>Anthony Bloesch</dc:creator><description>&lt;p&gt;If you can, use the SQL Server function newsequentialid() in the default clause of the primary key. Because these are allocated sequentially, they minimize fragmentation. If the GUIDs are allocated externally in the middle-tier then having the middle-tier use the Win32 API UuidCreateSequential will minimize fragmentation. I do not think there is a .Net equivalent so you need to wrap the call. In VB:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Declare Function UuidCreateSequential Lib &amp;quot;rpcrt4.dll&amp;quot; (ByRef id As Guid) As Integer&lt;/p&gt;
&lt;p&gt;in C#&lt;/p&gt;
&lt;p&gt; &amp;nbsp;[DllImport(&amp;quot;rpcrt4.dll&amp;quot;, SetLastError=true)]&lt;/p&gt;
&lt;p&gt; &amp;nbsp;static extern int UuidCreateSequential(out Guid guid);&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9242445" width="1" height="1"&gt;</description></item><item><title>re: SQL Server fragmentation</title><link>http://blogs.msdn.com/b/anthonybloesch/archive/2008/12/18/sql-server-fragmentation.aspx#9238153</link><pubDate>Fri, 19 Dec 2008 01:02:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9238153</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;If one project requires GUIDs what is the best way to use them without causing a lot of page fragmentation? Is using internal GUID better than external?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9238153" width="1" height="1"&gt;</description></item></channel></rss>