Re: non numeric primary key

From: Kyle Lahnakoski <kyle_at_arcavia.com>
Date: 2000/01/16
Message-ID: <3881EE57.CD29B093_at_arcavia.com>#1/1


Fernando wrote:
> I've been told that choosing a non numeric field as a primary
> key would hurt performance, is this true? O:-)

Yes. In most DB implementations the number of bits used to store an number is smaller than used to store a string (Space). Second, the algorithm used to compare strings is less efficient, per byte, than it is for numbers (Speed).

There could be implementations that are specifically suited for comparing short strings (4-8 chars) just as fast as numbers, but I would imagine they are rare.

-- 
----------------------------------------------------------------------
Kyle Lahnakoski                                  Arcavia Software Ltd.
(416) 892-7784                                 http://www.arcavia.com
Received on Sun Jan 16 2000 - 00:00:00 CET

Original text of this message