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: How long is long enough for primary key ?

Re: How long is long enough for primary key ?

From: <krislioe_at_gmail.com>
Date: 7 Oct 2006 00:00:12 -0700
Message-ID: <1160204407.898430.322410@i3g2000cwc.googlegroups.com>


Hi,

> Length is irrelevant.

I thougt that the long primary key is bad for performance, isn't it ?

And the long PK is the reason for using surrogate key, isn't it.

Thank you,
xtanto

DA Morgan wrote:
> krislioe_at_gmail.com wrote:
> > Hi,
> >
> > In our design, lookup tables (Customers, Products etc..) are using
> > natural key as PK. We use VARCHAR2(30) as PK column.
> >
> > Is it too long ? How long is too long ?
> >
> > Thank you,
> > xtanto
>
> Length is irrelevant.
> How many bytes is the data required to uniquely define a record?
>
> The only thing that matters are:
>
> First Normal Form:
> Make a separate table for each set of related attributes and uniquely
> identify each record with a primary key.
>
> Second Normal Form
> tables do not have composite primary keys
>
> Third Normal Form
> all non-key fields are dependent on the primary key
>
> Everything else is window dressing related to performance. And you
> don't mention anything performance related in your inquiry.
> --
> Daniel A. Morgan
> University of Washington
> damorgan_at_x.washington.edu
> (replace x with u to respond)
> Puget Sound Oracle Users Group
> www.psoug.org
Received on Sat Oct 07 2006 - 02:00:12 CDT

Original text of this message

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