Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Primary Key and indexes

Re: Primary Key and indexes

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 13 Sep 2000 21:29:49 +0200
Message-ID: <968877885.26196.0.pluto.d4ee154e@news.demon.nl>

If you don't do anything special, the index will have the same name as the constraint name and get created in the default tablespace.

use the following query to verify
select index_name, table_name, tablespace_name where index_name in
(select constraint_name
  from user_constraints
 where constraint_type in ('P'/*primary key*/,'U'/*unique constraint*/ )

Usually you should name the index (designer will do so for you) and/or create them in a different tablespace (which designer IIRC not do for you automatically).
Foreign keys will not get their index created automatically.

Hth,

Sybrand Bakker, Oracle DBA

"TurkBear" <johng_at_mm.com> wrote in message news:39bfc4e8.7568082_at_news.news-ituk.to...
> I am a little confused ( an understatement! )
>
> When creating a Primary Key constraint, the docs indicate that an implicit
 index
> is created...how can I verify that this is the case...I cannot find the
 index
> anywhere with DBA Studio's Schema Manager or TOAD or any other tool...Not
 that I
> doubt Oracle, but it would be nice to actually see the index...( is it
 under the
> same schema as the table ?, some odd name maybe? ...)
>
>
>
> Also, most of our Primary Keys were generated by Designer, and it seems
 some
> have indexes ( named the same as the constraint name) and some do
 not...however,
> it may be that the ones that have indexes had the primary key created
 AFTER the
> unique index was built and just used the existing index...
>
> any info appreciated...
>
> John Greco
>
>
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
Received on Wed Sep 13 2000 - 14:29:49 CDT

Original text of this message

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