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: Tibor Karaszi <tibor_at_cornerstone.se>
Date: Tue, 4 Jan 2000 17:36:43 +0100
Message-ID: <#et$SJtV$GA.262@cppssbbsa04>


I'd go with Itzik as well. Numeric.

Aside:
Over the weekend, I spent quite a few hours removing my surrogate keys. I kept only one, where I _really_ needed it for performance reasons...

--
Tibor Karaszi
MCDBA, MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB
Please reply to the newsgroup only, not by email.

Itzik Ben-Gan <itzikb_at_hi-tech.co.il> wrote in message news:#uD#jjpV$GA.274_at_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 - 10:36:43 CST

Original text of this message

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