Mike Yearwood
Toronto, Ontario, Canada
>>>HI,
>>>
>>>>
>>>>GUIDs are useful if users are not permanently connected. GUIDs are supposed to give unique values (based, in part, on the fact that each network card has a unique serial number). However, GUIDs are fairly long - 16 bytes.
>>>
>>>I prefer char type surrogated key. So, if I make it like an GUID in a char format, it will be 32 chars. I am worry that will affects performance in the long run....
>>
>>Of course it will affect performance. Why not use the 16-char GUID, and then have a function that converts to a readable form when you need it?
>>
>>Also, do you really need GUIDs? If all users are connected at the same time, a 4-byte Integer should also work. But you may still consider GUIDs if you plan to upsize your system later (to include disconnected users).
>
>Strictly speaking, I don't really need GUID, just as Sergey Berezniker has pointed out what a GUID key should be. In my case, I just need a non-sequential char type surrogated key, so I think I am cutting down the length, probably 8 to 12 chars since there are tables that I expect will grow huge in term of #records.
8 or 12 will not save enough to be any advantage. Go either integer or 16 byte GUID. Why stress yourself over this? The integer data type and the GUID datatype are very well understood. Coming up with some custom 8 / 12 byte "unique" key is a waste of time.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only