I'm developing on SQL Server 2005 and our database needs to be 'replication-capable'. To do this we have added a Guid column, with a uniqueidentifier type and marking the RowGuid column property to True. We also have an integer ID column marked as the primary key.
My question is if I should make this rowguid column the primary key in the tables in our database and get rid of the integer primary key. Will it make any difference on the speed of the indexes or anything? We have to have this thing there anyways so the argument against it because it causes bloat is not valid. I would think that since we've got this RowGuid there, and it's unique, we might as well use it for the index. I searched on google and couldn't find anything that said it's a performance hit. Our tables aren't going to have millions (let alone tens of thousands) of records.
Any comments on this?
B
Thanks everyone.
I haven't actually removed the integer primary key yet and have both it and the RowGuid column (which is only there for, and marked for, replication) in my DB. I was just pondering if it makes sense to combine them.
I posted this question on the sql server replication newsgroup also. It seems that SQL Server takes care of your integers colliding when replicating different databases. For example, on two different databases that are replicated, if you create a new item on each one, the PK is 1 on each record in both databases, but the data is different. Replication somehow will resolve this using the RowGuid column and probably a combination of the int primary key.
Thanks for the responses.
Brian
Copyright (c) Marimer LLC