Primary Keys
Pros of GUID
- [1] You can generate IDs client side or anywhere else
- [1] Unique across every table, database and server
- [1] Allows easy distribution of databases across multiple servers
- They can contain extra information, such as the creation timestamp.
Cons of GUID
- [1] Being 16 bytes in size, it’s 4x larger than a 4 byte autoincrement ID.
- [1] Cumbersome to debug
where userid='{BAE7DF4-DDF-3RG-5TY3E3RF456AS10}'
- [4] Very inefficient to index
- [4] Not all languages and environments directly support GUIDs (but most of them do)
References