When analyzing Oracle tkprof trace files, I noticed that sometimes there is a big difference between processor time and elapsed time, and I don’t know what causes it.
For instance:
call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 42.09 0 0 0 0 Execute 1 0.01 0.01 0 0 0 0 Fetch 45 14.44 62.71 48664 505513 0 1871 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 47 14.45 104.82 48664 505513 0 1871
Waiting statistics look like this:
Event waited on Times Max. Wait Total Waited ---------------------------------------- Waited ---------- ------------ SQL*Net message to client 46 0.00 0.00 SQL*Net message from client 46 0.19 1.68 buffer busy waits 559 0.23 8.59 db file scattered read 5204 0.21 7.49 db file sequential read 4240 0.20 13.49 latch free 215 0.11 3.62
I am a software developer (not a database administrator), so I usually look at these trace files to find inefficient queries or see if I can use the index to stop a full table scan, etc. For this, I usually continue the processor time. In most cases, elapsed time is very similar to processor time.
I do not have access to the database that generated the trace file (from the client’s site), but I would like to understand what is happening so that I can make suggestions on how to reduce the elapsed time.
source share