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