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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: foreign key constraint and the index_name in user_constraint table

Re: foreign key constraint and the index_name in user_constraint table

From: Jared Still <jkstill_at_gmail.com>
Date: Thu, 30 Sep 2004 17:44:56 -0700
Message-ID: <bf4638040930174450755327@mail.gmail.com>


On Thu, 30 Sep 2004 19:51:12 -0400, nn20002_at_netscape.net <nn20002_at_netscape.net> wrote:
> Now, how do I know that the foreign key constraint is using the index or not.

Assuming an update is taking place on one of the tables

*) look for table locks. the parent or child table will be locked

   ( dependant on oracle version) if the index is not used. *) use a 10046 trace. It will show index usage. *) look at the execution plan, either via explain plan or autotrace. I believe the index usage will appear there for an update statement. (though I'm too lazy to check at the moment, you do it ;)

Best thing to do is build parent/child tables and do some testing, so that you know what is going on when the foreign key is used, both with and without an index.

The concepts manual will give you more info.

-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Sep 30 2004 - 19:40:27 CDT

Original text of this message

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