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

Home -> Community -> Usenet -> c.d.o.misc -> Re: new to indexes

Re: new to indexes

From: <markp7832_at_my-deja.com>
Date: Mon, 13 Mar 2000 13:51:34 GMT
Message-ID: <8airp4$p83$1@nnrp1.deja.com>


In article <38CCD4B9.926326D1_at_fast.no>,   kev <kevin.porter_at_fast.no> wrote:
> Hi,
>
> I'm looking at how to index my (quite complicated) data. I'd like to
> know if there is a V$ view which will show me what indexes are already
> in existence. I couldn't find one - if there isn't, how else do I find
> this information?
> Also, if I've defined a primary key for each table, is an index
created
> automatically for them?
>
> thanks,
>
> - Kev
>

You can find out about database objects like indexes by looking at the dictionary views. There are normally three sets of views for each object all_x, dba_x, and user_x where x = tables, indexes, views, etc... The all_x views allow you to query information on objects you have object privileges on, while user_x show you only what you own, and dba_x show everything.

In your case you can find index information in sys.dba_indexes and can find the column(s) in an index listed in sys.dba_ind_columns.

To answer your question about PK's, Yes, if you declare a PK constraint Oracle automatically creates an index to support the constraint if you do not specific index naming and storage information in the declaration then Oracle uses defaults. See sys.dba_constraints.

You can find all the above in the Concepts manual; it is an excellent source that is well worth reading.
--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 13 2000 - 07:51:34 CST

Original text of this message

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