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: Robert Klemme <shortcutter_at_googlemail.com>
Date: Tue, 06 Mar 2007 12:07:01 +0100
Message-ID: <5550a2F2150hdU1@mid.individual.net>


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 Received on Tue Mar 06 2007 - 05:07:01 CST

Original text of this message

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