Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Surrogate Primary Keys - Integer or Character ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00397596
Message ID:
00397729
Vues:
16
>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?

I don't know about the frameworks. In vfp3, character PKs made it easier to hook up the controlsource of combos. Back then, an integer bound column made it store the .listindex in the value, with no .BoundTo property to turn off that idiotic behavior. Confronted with that problem, I changed my PKs in a vfp3 database to character. I then found that two tables in a view took twice as long to join. That might have been because vfp3 handled strings more slowly. When I upgraded to vfp6, that join went twice as fast. After that I changed the PKs back to integer and saw little or no improvement in speed.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform