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: Primary key or no primary key

Re: Primary key or no primary key

From: David Lane <dlane_at_cix.compulink.co.uk>
Date: Fri, 22 Jan 1999 04:27:40 GMT
Message-ID: <F5y1q5.F1E@cix.compulink.co.uk>


In article <787bf6$gb8$1_at_nnrp1.dejanews.com>, kshave_at_my-dejanews.com () wrote:

> Primary key or no primary key When a table is created and a primary key
> constraint is defined, a unique index is automatically set up for that
> constraint. Would there be any advantage or disadvantage to simply
> creating
> the index yourself and not defining a primary key for the table. A
> unique
> index is created in either case.
>
> I've looked through all of Oracle's books and I could not find an
> answer. Does
> anybody have any input?
>
> -Keith
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

We create the index first with the parallel option to speed things up .... if you then add a primary key with EXACTLY the same name as the index, Oracle uses the index to enforce the constraint rather than creating a new index. The same works for unique constraints.

Dave Lane (dlane_at_pt.lu) Received on Thu Jan 21 1999 - 22:27:40 CST

Original text of this message

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