Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Primary Constraints and Indexes

RE: Primary Constraints and Indexes

From: james ellis <jellis24_gso_at_yahoo.com>
Date: Fri, 12 Jan 2001 14:29:07 -0800 (PST)
Message-Id: <10739.126588@fatcity.com>


The major difference between a primary key and an unique index is if you want to enforce referential integrity you need a primary key to do so.

James
--- Sachin Puri <sachin_at_siworldwide.com> wrote:
>
> A Primary Key is a unique identification of a row in
> a database table.
> When a primary key is created an index is also
> created implicitly on that
> column.So u don't
> need any explicit index on that column which has a
> primary key constraint.
> There can be only one Primary Key in a table however
> u can have a number of
> indexes in a table.(depends on the oracle release as
> in Oracle 7.x u can
> have 16 indexes in a table)
> Explicit Indexes are generally used for fast data
> retrieval and perfomance
> enhancement.
>
>
> Rgds,
> Sachin Puri
> Oracle Development and Administration
> Solutions Infosystems
>
>
> -----Original Message-----
> Sent: Wednesday, January 10, 2001 9:16 PM
> To: Multiple recipients of list ORACLE-L
>
>
> As a part-time dba, I am confused about the
> differences between
> Primary Keys and Indexes.
>
> For example if I create a table "EMPLOYEES" and in
> the table
> creation statement I do something like:
> create table ...
> constraint XXX primary key (EMP_ID) using
> index ...
> then later I create an index:
> create index YYY on EMPLOYEE (EMP_ID) ...
> I know I have created two indexes (the first one
> system-named
> and implicitly created and the second name YYY and
> created
> explicitly) but do I really need the second index
> YYY?
> It seems to me the YYY index is not really needed?
> Can
> someone shed some light on this for me.
>
> THANKS, Wayne
> McGillWL_at_navair.navy.mil
>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Wayne McGill
> INET: McGillWL_at_navair.navy.mil
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists

>



> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).
>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Sachin Puri
> INET: sachin_at_siworldwide.com
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists

>

> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).

Received on Fri Jan 12 2001 - 16:29:07 CST

Original text of this message

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