I turned on the following tracing. "ALTER SYSTEM SET EVENTS '10046 trace name context forever, level 12';" and used tkprof with "tkprof.exe sid_ora_1264.trc tk01.out explain=schema/pwd@sid waits=yes sys=no sort=prsela,exeela,fchela"
Code:
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 2 0.00 0.00 0 0 0 0
Execute 2 8.70 19.58 1 6977 218960 2
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 8.70 19.58 1 6977 218960 2
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 40 (CCDOTTSVR)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net more data from client 829 0.01 0.14
SQL*Net message to client 2 0.00 0.00
log file sync 11 0.99 9.58
SQL*Net message from client 2 1.05 1.09
********************************************************************************
When I did that I noticed that the log file sync caused a substantial wait on a database where I am the only user. Also the query that I used befiore does not include an extraneous table that the application query is using. There are three tables that are relevant to this query. The detail table contains information on stuff that is being readied to be shipped, the p_agg_tbl is a parent table that describes a shipment, and the to the agg_tbl contains pointers to the detail table attempts to show what will be included in a given shipment. I had the agg_id moved to the agg_tbl so that a three way join would no longer be needed. I inlcuded part of the trace file with the waits.