Why I Hate GUIDs

Using a GUID as a primary key and or clustering key in SQL Server database tables is a subject for religious debate. Sure, they are unique, but they are also wide which makes your nonclustered indexes bigger as well. Some developers swear by them and will use nothing else.

I have a customer using the uniqueidentifier data type (the GUID of SQL Server) along with NEWSEQUENTIALID to populate them. Most columns of the tables are foreign keys, also uniqueidentifiers, so the database is almost completely GUIDs.

I was really excited to hear that many previously Enterprise only features would be available in Standard Edition starting with SQL Server 2016 SP1. I’m talking about features that I would really love to implement for this customer such as database compression, partitioning, and columnstore indexes. But, guess what, the uniqueidentifiers just won’t work with these features. Ugh. Changing from uniqueidentifiers to integers would be incredibly painful.

So, that is why I hate this data type. The only thing I like is that there are four pronunciations for GUID: gwid, goo-id, G U I D, and my favorite, gooey D.

About Kathi Kellenberger

I am the editor of the online journal Simple Talk. I love talking about SQL Server to anyone who will listen, just ask my five year old granddaughter. I love to write and teach. I am so humbled and honored to say I am a Data Platform MVP, a volunteer with LaunchCode and co-leader of PASS Women in Technology Virtual Group.
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Why I Hate GUIDs

  1. PeanutHead says:

    GUIDs are the spawn of the devil er… application developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s