Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Char vs Varchar in Index
Message
De
29/10/2003 07:43:45
 
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:
00843990
Vues:
18
Hi Mike

>We are putting together a database which will utilise 22 character UIDs as the primary key on most tables. Has anyone done any tests to see if there is a significant performance penalty for using varchar as the datatype for the primary and foreign keys rather than char?

As a general rule, the fastest and most efficient primary key in any database (SQL Server and ORacle included) is an INTEGER. CHAR is also invariably faster than VARCHAR and if you must use a 22-character field as the primary key that would be the better option. However I would still recommend that you keep the primary key on the table as an auto-generated integer since that will generally give you the best performance when dealing with inserts, updates and deletes.
----
Regards
Andy Kramek
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform