Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Which Index With This Constraint?
>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/~bytelifeReceived on Tue Dec 01 1998 - 08:20:36 CST
![]() |
![]() |