0 Replies Latest reply on May 23, 2011 2:56 PM by bknutson

    Use of GUIDs as Primary Keys

    bknutson

      I believe Orion's use of GUID Primary Keys as clustered indexes, may cause SQL performance degredation.

      Here are some comments found regarding this type of configuration:

      “There is no problem with using a GUID as the primary key. Just make sure that when you actually set the GUID to be the primary key then set the index it automatically creates to be of type Non-clustered. A lot of people forget (or don’t know) to do this in SQL Server. NEVER use a clustered index on a GUID. This will cause a physical ordering around the GUID on disk, which is obviously pointless (as others have already pointed out)”

      “A clustered index on GUID is not a good design. The very nature of GUID is that it's random, while a clustered index physically orders the records by the key. The two things are completely at odds. For every insert SQL has to reorder the records on disk! Remove clustering from this index!”

       

      We had a new product being worked on for over a year with no DBA involvement. At random times throughout the year, 5 different DBAs happened to see the schema and remarked that the GUIDs as PKs would cause performance issues…”