Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is the use of VARCHAR(256) as Primary Keys preferred in Oracle?
Hi,
Could you please explain to me what's surrogate/natural key ?
TIA
"Pablo Sanchez" <pablo_at_dev.null> wrote in message
news:Xns92C9DB9A7997Epingottpingottbah_at_209.242.64.107...
> "Paul Brewer" <paul_at_paul.brewers.org.uk> wrote in
> news:3dd8142b_1_at_mk-nntp-1.news.uk.worldonline.com:
>
> > Personally, if a 'natural' VARCHAR2 key of reasonable length (say
> > 4 to 12) were available, I for one would not be inclined to invent a
> > numeric surrogate key.
>
> I would dissuade folks from using natural keys as their primary key.
> Using surrogate keys gives the application a layer between the
> business (primary key) and the implementation (surrogate key).
>
> Business rules change and what someone says will _never_ happen is
> ephemeral.
>
> I would still use the natural key but as an alternate key with a
> UNIQUE constraint on it.
> --
> Pablo Sanchez, High-Performance Database Engineering
> http://www.hpdbe.com
Received on Sun Nov 17 2002 - 23:42:17 CST