Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Surrogate number primary keys
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00053556
Message ID:
00053562
Vues:
27
>If I use an incrementing number as a surrogate primary key, why should I make it a character field? Tastrade does that, and I've heard that it's the thing to do. But a key like this is not useful for ordering the records, and therefore would not be part of compound index expressions. Wouldn't it be better to use a double field?

Old foxpro stored numeric field as character internally, therefore evaluating of index expression would just take one more internal step, and also character field (as you mention) had obvious advantage for constructing compound keys.
Visual Foxpro integer filed is not charater-like anymore, and actually it takes less bytes, therefore internal processing will be even faster. So, VFP prefers integer for surrogate primary keys.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform