Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What should the primary key be?
Message
From
03/02/1999 21:13:43
 
 
To
03/02/1999 11:11:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00182646
Message ID:
00183736
Views:
22
>I totally respect your POV on integer primary keys, and I am moving toward it. But I do have a fondness for character keys, and am somewhat reluctant to let them go.
>
>I like them because they can make use of information (i.e. base them on system, user, date, etc). Since they are surrogate keys you in effect have a permanent marker about when and who created the created the record. If one does any auditing at all, then you have this information being stored anyway.
>
>As for the speed and size issue. Yes, but, by far, a character primary key is not going to be the biggest or slowest object in a VFP system. I see more performance gains optimizing page creation, using parameterized views, and so on.
>
>>How much space does it take to store your GUID? Integers are small and VERY fast. Faster than character.

I agree...there are some advantages to character keys. However, IMO, the benefits of integer keys strongly out weigh the benefits of character keys. Go back to the FPA articles that Mac Rubel did in the last couple of years. He ran the tests.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform