Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Surrogate Primary Keys - Integer or Character ?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00397596
Message ID:
00397609
Views:
20
>The only good reason I can think of to use a character based primary key is that it allows for the use of concatinated keys. This ability doesn't seem to out-weight the performance issues so why would I ever use a character based primary key? Am I missing the boat here? Is there some hidden advantage to it? If not, why do most all of the frameworks I have looked at default to it?

The performance issues between character- and integer- based keys is not that significant when dealing with small character fields. Integers are 4 bytes with a maximum of 2.147 billion. A 4 byte character field has 4.29 billion possible values. While this exceeds the current 2GB record limit of VFP tables, this may not be true in the future. Also, there is the matter of discarded key values to account for. So you may need more than 2 Gig values.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform