Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Oracle / Oracle Server / April 2006

Tip: Looking for answers? Try searching our database.

data dictionary query with 7million consistent gets ! ? !

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mike - 28 Apr 2006 20:01 GMT
Why would a query of  all_constraints cause  7 million consistent gets
and take nearly two minutes ?

On a similarly configured instance it only takes about 700 CGs and 0.02
seconds.
Oracle 9.2.0.6 on wintel .

CRW32.exe  (crystal reports)  generates this query when linking tables
as it looks for FK relationships.

Thanks !

SELECT     p_constraint_table.CONSTRAINT_NAME
         p_constraint_table.OWNER
         p_constraint_table.TABLE_NAME
         f_constraint_table.CONSTRAINT_NAME
         f_constraint_table.OWNER
        f_constraint_table.TABLE_NAME
FROM       ALL_CONSTRAINTS f_constraint_table
         ALL_CONSTRAINTS p_constraint_table
WHERE
f_constraint_table.R_CONSTRAINT_NAME=p_constraint_table.CONSTRAINT_NAME
AND        p_constraint_table.CONSTRAINT_TYPE='P'
AND        f_constraint_table.CONSTRAINT_TYPE='R'
AND        f_constraint_table.OWNER ='GPW'
AND       ( f_constraint_table.TABLE_NAME='FCI_AGREEMENT'      or
f_constraint_table.TABLE_NAME='FCI_CONTRACT'  )
/

1 row selected.

Elapsed: 00:01:56.08

Statistics
----------------------------------------------------------
         0  recursive calls
         0  db block gets
   7738081  consistent gets
         0  physical reads
         0  redo size
       761  bytes sent via SQL*Net to client
       498  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         1  rows processed
joel-garry@home.com - 28 Apr 2006 22:41 GMT
> Why would a query of  all_constraints cause  7 million consistent gets
> and take nearly two minutes ?
[quoted text clipped - 28 lines]
>
> Elapsed: 00:01:56.08

(the following is easy in OEM and similar tools):

Look at the definition of the all_constraints view.

For each table mentioned there, in both instances, see if there are any
statistics, and be sure all indices are there and valid.

I'm guessing the CBO is being fooled by the recursive self joins and
funny statistics (or problematic indices) into repetitively full
scanning obj$.  I'm predicting your faster instance won't have
statistics.  Make wooeeewoooeee sounds now.

jg
Signature

@home.com is bogus.
http://www.janus-software.com/fb_fyracle.html

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.