Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Connection Constraint - Index
The last one you created
or The first one you created
or The one with the columns in the order of the constraint
or The one with the columns in the reverse order of the constraint
Traditionally you might expect to create three indexes
(a,b,c) (b,c) (c)
Rather than three indexes with three columns each
--
Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk
Martin Haltmayer wrote in message <38AD7160.E8BB7605_at_0800-einwahl.de>...
>How can I find out which index is used for enforcing a unique or primary
>constraint?
>
>Consider the following:
>
>
>drop table test cascade constraints;
>
>create table test (
> a number not null
> , b number not null
> , c number not null
>);
>
>create unique index test_bac on test (b, a, c);
>
>create unique index test_cba on test (c, b, a);
>
>create unique index test_abc on test (a, b, c);
>
>alter table test add (
> constraint test_pk primary key (a, b, c)
>);
>
>drop index test_abc;
>
>drop index test_bac;
>
>drop index test_cba;
>
>Now guess which index gives you
>
>ORA-02429: cannot drop index used for enforcement of unique/primary key
>
>Martin
>
>
Received on Fri Feb 18 2000 - 12:12:48 CST