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: Two indexes same columns

RE: Two indexes same columns

From: Jack C. Applewhite <japplewhite_at_inetprofit.com>
Date: Fri, 29 Jun 2001 08:11:41 -0700
Message-ID: <F001.0033D943.20010629080533@fatcity.com>

Connie,

When you create the PK constraint, Oracle automatically creates a unique index to enforce it. You should explicitly name the tablespace in which this index is to be created. Otherwise Oracle will just create it in the scema owner's default tablespace - not necessarily a performance enhancer, since that could be the very tablespace in which the table resides.

The PK index is all you need on the PK columns, unless you frequently access the table via the 2nd (or 3rd) PK column. Then you could create a UK on the same columns, but in a different order. It all depends on your application's access of the table, as well as the FKs you've defined (you need an index on each FK to reduce table locking - see the docs for more info.).

Jack



Jack C. Applewhite
Database Administrator/Developer
OCP Oracle8 DBA
iNetProfit, Inc.
Austin, Texas
www.iNetProfit.com
japplewhite_at_inetprofit.com
(512)327-9068

-----Original Message-----
Milliken
Sent: Friday, June 29, 2001 10:46 AM
To: Multiple recipients of list ORACLE-L

If there is a primary key on a table (which inherently builds an index), is it still necessary for performance to build a seperate index on the same columns as those identified in the primary key or is the index generated by the primary key sufficient?

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jack C. Applewhite
  INET: japplewhite_at_inetprofit.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 Jun 29 2001 - 10:11:41 CDT

Original text of this message

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