Schema - Do you avoid using indexes on RowGuid column?
  v5.0 Posted at 21/05/2020 3:40 PM by Christian Morford-Waite

​​​RowGuids (uniqueidentifier) are large fields (16 bytes) and are basically going to ALWAYS​ be unique.​

SQL Server adds a RowGUID column to all tables if you are using Merge Replication (but doesn't add an index).​​

RowGuids in general slow things down. Some people may consider using a RowGuid as their primary key. This is a bad idea because the index is going to be quite slow.... you are searching a large field. It goes without saying, NEVER have clustered index on a RowGuid column.​​

​Another little annoyance with RowGuids is when you are searching for one. You can't use > or < on a RowGuid column.

​Note: There are not many cases where a RowGuid should have an index on it. 

Be aware that SQL server adds this column when you perform merge replication. There are not many cases where this should have an index on it.

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address: