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: Optimized Query on data dictionary

Re: Optimized Query on data dictionary

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Mon, 13 Mar 2000 12:27:07 +0100
Message-ID: <8aijai$qqq$1@news3.isdnet.net>


select distinct (b.table_name)
from dba_constraints b, dba_constraints a

where b.owner = 'SCOTT'
  and b.constraint_name = a.r_constraint_name
  and a.constraint_type = 'R'
  and a.owner = 'SCOTT'
  and a.table_name = 'EMP'

;

--
Have a nice day
Michel

<jeanch_at_my-deja.com> a écrit dans le message : 8aidif$fla$1_at_nnrp1.deja.com...
> Folks,
>
> The following query take about 5mn to return results;
> Obvioulsy it's not acceptable; Has anybody an idea
> about how to cut down that time please.
>
> Any help is welcomed
>
> Cheers
> JC
>
> select distinct (table_name)
> from all_cons_columns
> where owner = 'SCOTT'
> and constraint_name IN
> (select r_constraint_name
> from all_constraints
> where constraint_type = 'R'
> and owner = 'SCOTT'
> and table_name = 'EMP'
> );
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Mar 13 2000 - 05:27:07 CST

Original text of this message

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