Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Key fields: alpha vs. numeric
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00318449
Message ID:
00318451
Vues:
25
G'day Denis,

My understanding (and like yours, it's hear-say, rather than a result of personal observation) is that the fields need to be numeric type, more specifically, they need to be of type INTEGER. This is because INTEGER fields are stored as their binary representation and therefor don't have the associated overhead of character to binary conversion during the indexing process.

On your philosophical point, I agree in principle. Character fields should be used for non-numeric data, non-computational data, even if the field is only going to contain numeric characters (for example for postal codes). Key fields are an exception though. If you are using meaningless surrogate keys, they will never be displayed to the user or used for anything other than being key fields. Because of this, you should use the most efficient field type for the task.

Cheers,

Andrew

>I have long heard that numeric values in key fields improve performance (when key fields are relevant to the current operation). I have heard it enough from various (apparently) reliable sources that I believe it. My question is ( - in general and for VFP if there is a distinction):
>
>Is the benefit realized with numeric values in text/character type key fields or numeric type key fields? In other words, would I realize this benefit by using values composed only of 0-9 in a character type key field?
>
>To digress just a bit, I have always had a philosophical hang up with using numeric type fields for essentially non-numeric data? Crudely re-stated, I object to using numeric fields if no calculation would likely ever be relevant. In no cases that I have observed would a calculation be relevant on the values of key fields.
>
>Thanks.


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform