Showing posts with label tkprof. Show all posts
Showing posts with label tkprof. Show all posts

Wednesday, December 22, 2010

tkprof trace file analysis.....

Friends & Experts,

Examine the below trace file, which generated after running
the application for 7 mins. The person who give me this trace
file told me to tune this query, because his application takes
around 7 mins to complete one task which suppose to takes only
few second.


Can you figure out what the problem is ?

SELECT MIN(DATE_Column)
FROM
SOME_TABLE WHERE SOME_COLUMNE = :B1

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ------- ---------- --------- --------
Parse 41 0.00 0.00 0 0 0 0
Execute 10846 3.99 4.17 0 0 0 0
Fetch 10846 23.04 24.39 0 264858 0 10646
------- ------ -------- ---------- ------- ---------- --------- --------
total 21733 27.03 28.57 0 244858 0 10646

Lets, first try to locate the problem.

Execution count=10846
Elapsed Time=28.57, So on avg one execution takes around 3ms....So this is good
Consistent read block=264858, So on avg 24 blocks/execution....So this seams OK..


Than, where the problem is?? Problem is in Application designing(coding).
Out of 7min of tracing only 29 second used by this query, So where the remaining
400 seconds spent by application. One should need to find out this, for this it is
require to look at detailed application tracing and/or statspack/AWR report.

One more thing I like to raise here: Why application executes this query 25 times
per second? If there are multiple session going on simultaneously then this is ok,
Otherwise we need to look at this also.(Actually I saw one application which executes sql
50 times per second because of poor application coding only.)