Data dictionary queries issued by PLSQL Dev. causes cartesian join

Bert Gombos

Member²
When I use Describe Object functionality, PLSQL Developer (9.0.6) issues this:

select t.*, o.*, m.comments from sys.dba_tables t,
sys.dba_tab_comments m,
sys.dba_objects o
where t.owner = :object_owner
and t.table_name = :object_name
and m.owner (+) = :object_owner
and m.table_name (+) = :object_name
and o.owner (+) = :object_owner
and o.object_name (+) = :object_name
and :object_type is not null
and :sub_object is null

This is not good because of lack of joins. It causes merge join cartesian on some big databases.

Please use this:

select t.*, o.*, m.comments from sys.dba_tables t,
sys.dba_tab_comments m,
sys.dba_objects o
where t.owner = :object_owner
and t.table_name = :object_name
and m.owner (+) = t.owner
and m.table_name (+) = t.table_name
and o.owner (+) = t.owner
and o.object_name (+) = t.table_name
and :object_type is not null
and :sub_object is null

Review of all data dictionary queries is recommended.

 
Hey there sorry to resurrect this question, but we've having the same exact issue. Is there a solution to this? We've upgraded to 11.2 and just started getting this issue on tables with a large number of partitions.

This is happening in version 10.0.5.1710.
 
We have a fix available for 10.0.5. Please send an e-mail to support@allroundautomations.com to obtain the fix.
 
Back
Top