Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you decide the length of GUID field?
Message
From
07/08/2008 08:47:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
07/08/2008 01:35:53
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01336497
Message ID:
01337194
Views:
21
>>>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.

And why must it be of type Character? A type Integer uses only 4 bytes, but numbers can go all the way to 2e9 (2000 million). I don't see any advantage in using Character.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform