View Single Post

   
  #3 (permalink)  
Old 02-25-2008, 08:39 AM
krislioe@gmail.com
 
Posts: n/a
Default Re: How long is long enough for primary key ?

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@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@x.washington.edu
> (replace x with u to respond)
> Puget Sound Oracle Users Group
> www.psoug.org


Reply With Quote