Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you decide the length of GUID field?
Message
De
08/08/2008 09:35:14
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
07/08/2008 01:35:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01336497
Message ID:
01337500
Vues:
20
>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform