Home » RDBMS Server » Server Administration » urgent: query on system tables taking lot of time
urgent: query on system tables taking lot of time [message #372607] Tue, 27 February 2001 09:54 Go to next message
sanjeev vasistha
Messages: 2
Registered: February 2001
Junior Member
can anybody tell me why following query is taking lot of time ?

This query is automatically generated by oracle jdbc driver whenever we call getcrossreference method of DatabaseMetaData class.

SELECT NULL AS pktable_cat,
p.owner as pktable_schem,
p.table_name as pktable_name,
pc.column_name as pkcolumn_name,
NULL as fktable_cat,
f.owner as fktable_schem,
f.table_name as fktable_name,
fc.column_name as fkcolumn_name,
fc.position as key_seq,
NULL as update_rule,
decode (f.delete_rule, 'CASCADE', 0, 1) as delete_rule,
f.constraint_name as fk_name,
p.constraint_name as pk_name,
NULL as deferrability
FROM all_cons_columns pc, all_constraints p,
all_cons_columns fc, all_constraints f
WHERE 1 = 1
AND p.table_name = 'CSO_REC'
AND f.table_name = 'CL_REC'
AND f.constraint_type = 'R'
AND p.owner = f.r_owner
AND p.constraint_name = f.r_constraint_name
AND p.constraint_type = 'P'
AND pc.owner = p.owner
AND pc.constraint_name = p.constraint_name
AND pc.table_name = p.table_name
AND fc.owner = f.owner
AND fc.constraint_name = f.constraint_name
AND fc.table_name = f.table_name
AND fc.position = pc.position
ORDER BY fktable_schem, fktable_name, key_seq
Re: urgent: query on system tables taking lot of time [message #372610 is a reply to message #372607] Tue, 27 February 2001 11:53 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
This query takes 1 sec on my DB having over 4000 recs in each of those constraint views.
Re: urgent: query on system tables taking lot of time [message #372636 is a reply to message #372607] Thu, 01 March 2001 09:11 Go to previous message
sanjeev vasistha
Messages: 2
Registered: February 2001
Junior Member
In our case query the parse time for query is 4680 and that's why it is taking lot of time.

Is there any parameter that is causing problem.

Thanks,
Sanjeev
Previous Topic: Creating Views
Next Topic: Copying Tables between IDs
Goto Forum:
  


Current Time: Sat Jun 29 00:02:30 CDT 2024