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: Sequences as primary key experience?

Re: Sequences as primary key experience?

From: Simon Griffiths <s.griffiths_at_virgin.net>
Date: Wed, 01 Jul 1998 22:46:08 +0100
Message-ID: <359AAE20.ED795F91@virgin.net>

Jackie Marino wrote:

> Does anyone have any advice/experience on using sequences as primary
> keys? We are going to use them for almost all of our tables and would
> like to know any potential problems.
>
> Thanks in advance,
> Jackie Marino

  If the table already has a clear primary key, then why not use it ?? Any additional
column you add takes up space.

On a purely practical viewpoint, a database which consists primarily of surrogate
keys is much more difficult for people new to the schema to understand.

You also make 'short-cut joins' much more difficult . eg customer, order, order-line
to get all order-lines for a customer means a three-table join. If the key of
order-line is defined as cust-id, ord_id, ord_line_no then the primary key
index of the order line immediatly gives the required rows with no joins.

Simon. Received on Wed Jul 01 1998 - 16:46:08 CDT

Original text of this message

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