Scaling the Database: Why You Shouldn’t Cluster on GUIDs

My latest blog post on Go Daddy’s Insiders site is now live! In it, I discuss query performance and scalability issues with GUIDs. Read the article and let me know what you think. :)

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
Tagged , , , , . Bookmark the permalink.

4 Responses to Scaling the Database: Why You Shouldn’t Cluster on GUIDs

  1. Scott Newman says:

    Clear, concise, simple. Love it. I’ll be pointing developers to this article when asked if GUIDs are a good choice for clustered indexes.

  2. Massimo Gentilini says:

    Clear, but the bigint solution will require re-architecting the part of the application that creates keys and will cause some issue when porting data. Beside that if you need to partition your database across multiple servers you’ll have to manage the bigint partitioning as well.
    Can you also elaborate on the same scenario (GUID keys) but using sequential guids instead of standard ones?

  3. As many pointed out in the comments to the article, using newsequentialid() instead would help with the fragmentation issue. But a guid is still a guid, taking up lots of space in leaf level of NCIs, so it doesn’t solve all of the space issue (though again, less page splits was probably explaining most of your disk-saving in the 4,5 billion row table example).
    Nice article though! There are lots of tables out there having guids as PK, where the guid is created somewhere else than in the database (Entity Framework eg), and then there is no such thing as sequential guid, so clustering on something else than a guid is very relevant anyway.
    Thanks for a great, easy-to-understand graphical explaination to external and internal fragmentation!

  4. Jesse Reich says:

    Is this article still available? When clicking on the link, I just go straight to the Go Daddy homepage. There doesn’t seem to be any way to get to a Go Daddy Insiders area…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>