Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much I can rely on GUID in .Net?

How much I can rely on GUID in .Net ? My SA told me that

we will use GUID as primary keys in all tables.

I wonder the reliability of GUID as a primary key.

Can there be any chances that there will be duplicate ?

Should we really use this way ?

How about the performance ?

Any advise would be helpful for me.

like image 381
kevin Avatar asked Sep 13 '11 06:09

kevin


1 Answers

This are some points for GUID which give you answer

Advantage:

  1. Unique across the server.

Disadvantage:

  1. String values are not as optimal as integer values for performance when used in joins, indexes and conditions.
  2. More storage space is required than INT.

You can read full post aobut this at : SQL SERVER – GUID vs INT – Your Opinion

like image 166
Pranay Rana Avatar answered Oct 04 '22 00:10

Pranay Rana