Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Char vs Varchar in Index
Message
De
29/10/2003 11:48:28
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00843921
Message ID:
00844124
Vues:
28
Hi Larry

>Why is CHAR faster than VARCHAR? Have you run tests on this yourself? Or did you see an article by someone who did? I'm curious.

If you check the SQL Server Books OnLine you will find the following statement under the help for "char and varchar"

  • Use char when the data values in a column are expected to be consistently close to the same size.
  • Use varchar when the data values in a column are expected to vary considerably in size.

    No specific reason is given for these statements in this screen, but if you then read around the indexing stuff you will find reference to the fact that indexes on fixed width columns are more efficient and more easily maintained than variable width columns.

    My own experience with very large data sets would tend to confirm that this is actually the case too. Fixed width columns are much easier for the system to manage than variable width.
    ----
    Regards
    Andy Kramek
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform