Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GUID as Primary Key
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00754530
Message ID:
00754598
Views:
24
>I would suggest the GUID too. However, most of these distributed type applications require a field for location...and that's a one time setup.
>
>


Also, performance can also be an issue. In theory, I love the idea of GUIDs, and about two years ago I started using them a lot... well, guess what? They are bulky and slow down SELECTs, and the code to generate them is a touch slow compared to similar key generation code I have used...

If I had it to do over again, I would have assigned a unique 2 or 3 byte location code, and then created a primary key that was the location code + a unique ID. While this duplicates some info (the location code), it gives you a primary key that's not a compound key, and most likely, it will be smaller and quicker than a GUID.




>>>
>>>1) Use a compound PK with two fields, location and recordID
>>
>>That makes it a compound key!
>>
>>>2) Use a GUID.
>>
>>This is what I would suggest. It does not require compound primary keys and no maintenance if more location get added
>>
>>
>>
>>I believe there is a API call to get the GUID
>>
>>Peter
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform