I have seen two data types unique identifier and long int as primary keys of data table many times. Which one is better? Please share your opinions. Advantages and disadvantages over each other of both of them.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ADVANTAGEOUS OF GUID:
unique identifier is better because
guaranteed to always return aunique value across space and time
I don’t know the full mechanics of creating a GUID, but I seem to
remember that it has something to do with the MAC address on your
network card and the system time.
This comes in handy if you’re
consolidating records from multiple, as in a data warehousing situation.SQL Servers into one table
GUIDs are also used heavily by SQL Server replication to keep track of rows when they’re spread out among multiple SQL Servers.
DISADVANTAGEOUS OF GUID:There is no way to determine the sequence in which uniqueidentifier
values were generated. They are not suited for existing applications
that depend on incrementing key values serially
The main disadvantage to using GUIDs as key values is that they are
BIG. Indexes built on GUIDs are going to be larger and slower than
indexes built on IDENTITY columns
randomness