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: Is Primary Key always the index of the table in Oracle?

Re: Is Primary Key always the index of the table in Oracle?

From: <fitzjarrell_at_cox.net>
Date: 6 Mar 2007 08:00:39 -0800
Message-ID: <1173196839.451263.202720@t69g2000cwt.googlegroups.com>


On Mar 6, 5:07 am, Robert Klemme <shortcut..._at_googlemail.com> wrote:
> On 06.03.2007 08:49, Arto Viitanen wrote:
>
> > Kaka wrote:
> >> Can someone explain to me if the Primary Key always the same as Index
> >> of the table in Oracle? If not, how are they related? Thank you in
> >> advance!
>
> > Index is a structure Oracle uses in accessing the table, when it feels
> > it is faster to do so. Indexes have one or several attributes of the
> > table and a reference to the rows in the table that have those values.
>
> Actually with index organized tables the index *is* the table. The OP
> probably comes from an MS SQL Server background where the clustered
> index *is* the table. An IOT in Oracle resembles a SQL Server table
> with CI.
>
> > Since primary key is a constraint that an attribute or attributes of
> > the table can have only one row per one value of the attribute
> > (or set of attributes if there are more than one), almost all RDBMSs
> > make an index for the primary key. But, you can add more indexes to
> > the table, and remove them if you like.
>
> IIRC you can make Oracle create a constraint without an index. Not very
> useful most of the time but I think you can do that.
>
> Kind regards
>
> robert

Actually what you can do is use a non-unique index for a primary key constraint. You cannot have a primary key constraint without an index.

David Fitzjarrell Received on Tue Mar 06 2007 - 10:00:39 CST

Original text of this message

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