Re: Primary Key vs. UQ Index

From: John Malathronas <John_at_scroll.demon.co.uk>
Date: Wed, 14 Dec 1994 23:51:12 +0000
Message-ID: <275296462wnr_at_scroll.demon.co.uk>


In article: <James.Lawrence.26.00109818_at_epamail.epa.gov> James.Lawrence_at_epamail.epa.gov (Lawrence James) writes:
>
> In article <3ar8s4$j02_at_abacus.tis.tandy.com> bpearc1_at_abacus.tis.tandy.com
> (Byron Pearce) writes:>From: bpearc1_at_abacus.tis.tandy.com (Byron Pearce)
> >Subject: Primary Key vs. UQ Index
> >Date: 21 Nov 1994 23:01:24 GMT
 

> >Which is the more accepted method for enforcing a UNIQUE primary key:
> >the use of the PRIMARY KEY constraint or the use of a UNIQUE index
> >on the primary key field(s)? I can see pros and cons (such as being
> >able to control extent size and spread i/o by placing the tables and
> >indexes on different disks -- something you cannot do with a PRIMARY
> >KEY).
>
> Check your SQL reference manual, you can specify tablespace and storage
> clauses with both the unique and primary key constraints via the 'using index'
> clause. Both work via the unique index so the rational for one over the
> other is just logical. IE An employee id is a primary key, the SSN is unique.
>
> Lawrence......
>

Note that you have to be careful in that a simple primary key constraint will
create the index in the same tablespace as the data; you have more control when you huld a un ique index


John Malathronas       | My opinions are my own, so I change them daily. +
-----------------------|                                                 |
john_at_scroll.demon.co.uk| "Only fools learn from their own mistakes " +
-----------------------|---------------------------------------------------
Received on Thu Dec 15 1994 - 00:51:12 CET

Original text of this message