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: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 06 Oct 2006 21:29:13 -0700
Message-ID: <1160195348.286804@bubbleator.drizzle.com>


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 Fri Oct 06 2006 - 23:29:13 CDT

Original text of this message

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