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: Which Index With This Constraint?

Re: Which Index With This Constraint?

From: R.Schierbeek <bytelife_at_worldonline.nl>
Date: Tue, 1 Dec 1998 15:20:36 +0100
Message-ID: <740t72$603$1@news.worldonline.nl>


>How do I discover which index a given constraint uses?
>I defined indexes on specific tables and columns, then defined constraints
>which apply to the same columns. I think Oracle may manage to understand
>and use the existing indexes.

Hello Gordon,
Wrong way around. Define constraints, Oracle will make the indexes: CREATE TABLE DEMO_TABLE1

     (DEMO_ID   NUMBER(10)    NOT NULL                       -- Primary key
field
     ,KGLLOCK   VARCHAR2(10)  NOT NULL
           ,CONSTRAINT DEMO1_PK PRIMARY KEY (DEMO_ID)
            USING INDEX                                    -- *** unique
primary key
            STORAGE (INITIAL 100K NEXT 100K PCTINCREASE 0) -- index storage
     )

Name of index *** will be DEMO1_PK !

Good luck, Roelof

PS: good constraint script on
http://home.worldonline.nl/~bytelife/sql4dba.htm which shows all constraints of 1 owner.

                                             ---|---
R.Schierbeek, DBA         _____________________ | _____________________
Bytelife bv  Netherlands                       (_)

email: bytelife@worldonline.nl         http://home.worldonline.nl/~bytelife




Received on Tue Dec 01 1998 - 08:20:36 CST

Original text of this message

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