Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Type of surogate primary key

Re: Type of surogate primary key

From: Itzik Ben-Gan <itzikb_at_hi-tech.co.il>
Date: Tue, 4 Jan 2000 11:47:19 +0200
Message-ID: <#uD#jjpV$GA.274@cppssbbsa05>


> Which is the best type for the surrogate key (pure) numeric or
alphanumeric?

If you are talking about a meaningless Surrogate key as opposed to an Intelligent key, I would go for a numeric key. It is a lot easier to have it auto incremented (e.g., with the IDENTITY property), it is small, and the database engine will handle it with less complex calculations.
An alphanumeric key will probably require more space, you will need a special mechanism to have it auto incremented (e.g. triggers) and also, you will probably need to perform more complex calculations and conversions to increment it.

> I've taken a design decision to use for all my database tables surrogate
primary key. I don't want to argue about this (there are pros and cons).

Still, I would suggest that you read chapter 17 (Keys) of Data & Databases: Concepts in Practice by Joe Celko before you make up your mind.

--
Itzik Ben-Gan
SQL Server MVP
Hi-Tech College, Israel

http://www.mcse.org.il/isql

Dan G <Gavrilescu.Daniel_at_pmintl.ch> wrote in message news:84sbn6$k6a$1_at_pollux.ip-plus.net...
> Hello all,
>
> and a HNY in 2000.
>
> I've taken a design decision to use for all my database tables surrogate
> primary key. I don't want to argue about this (there are pros and cons).
> The question is:
> Which is the best type for the surrogate key (pure) numeric or
alphanumeric
> ?.
> Any pros and cons will be appreciated (index consideration, space
> allocation, programming any drawbacks.
>
> Thanks,
> Daniel.
>
>
Received on Tue Jan 04 2000 - 03:47:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US