Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Char vs Varchar in Index
Message
From
29/10/2003 11:48:28
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00843921
Message ID:
00844124
Views:
27
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
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform