Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Two indexes same columns
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
-----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-LReceived on Fri Jun 29 2001 - 10:11:41 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |