I see heated discussion all over the internet about whether a GUID is a poor choice for a primary key. Usually, these conversations all revolve around SQL Server.
A lot of people say that the size difference is an issue. (GUID = 16bytes, BIGINT = 8bytes, INT = 4bytes). Is this due to physical HDD space, or page space (fragmentation?)
For sake of conversation, lets say we have a 'PEOPLE' table:
create table "people"
(
ID uniqueidentifier not null default newid(),
first_name varchar(100),
last_name varchar(100),
ssn varchar(9)
);
alter table "people"
add constraint PK_PEOPLE primary key (ID);
How bad of a design is that over using a BIGINT or an INT?
We have a lot of new development going on in a legacy application, and we are tossing GUIDs on every table. We do have to take into account replication (which is why we went with GUIDs as opposed to INTs and 'Hold Keys', as we call them)
Thanks!
Calvin