Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Keys Document
Message
De
08/08/2001 10:00:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
08/08/2001 09:47:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00539860
Message ID:
00541258
Vues:
12
>I knew this, but your statement suggested otherwise. I don't think it would hurt to mention that ACCESS or SQL or xxxx has this kind of thing, because I do think that this fact helps to substantiate that surrogates are neither 'unusual' nor 'dangerous'.

OK, I will put this information back in, including your "caveats", i.e., the DBMS offers auto-incremented fields, but doesn't force the developer to use them.

>As for speed, this is a tougher one in my opinion. I would tend to say the it can go either way, depending on many factors.

I only compared an integer vs. a 10-byte character. 10,000 records with randomly generated keys in one table, and 100,000 records in another ("child"), with an average of 10 "child" records for each "parent".

I will leave it to the reader to do extensive testing - if so desired - for other cases, especially: longer character fields, composite indices, dates. (This reminds me of another change: since the document is getting quite large, I am moving functions to appendices.)

I did get approximately a 20% speed advantage with 10-character fields (compared with integers), and found this really surprising! Surprising, that is, if you consider the smaller size of integers. I had heard a few years ago that integers are "smaller, therefore faster" (for joins) - for instance, if I remember correctly, an article in FoxPro Advisor, "Real Programmers use Integers", made this claim - and I believed this until recently, that is, until you asked me to test this assumption.

>I'm looking forward to this document!

Well, it'll be a few days.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform