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

Home -> Community -> Mailing Lists -> Oracle-L -> Slow query

Slow query

From: Thomas Day <tday6_at_csc.com>
Date: Mon, 16 Aug 2004 13:53:23 -0400
Message-ID: <OF95178997.348A35D7-ON85256EF2.0061F936@csc.com>

I'm trying to find all the columns, in tables owned by a given schema, where the column name is like any other column name but not a constrained column. It takes forever. Any ideas on how to speed this up? It's Oracle 9.2.

select /* FIRST ROW */ UNIQUE a.table_name, a.column_name from dba_tab_columns a, dba_tab_columns b,
 dba_cons_columns c
where a.column_name like '''%'||b.column_name||'%''' and a.column_name not in
(select /* RULE */ c.column_name from dba_cons_columns c) AND A.COLUMN_NAME != B.COLUMN_NAME and a.owner = 'owner' /



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Mon Aug 16 2004 - 12:49:27 CDT

Original text of this message

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