Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Optimized Query on data dictionary
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
![]() |
![]() |