A reader, April 05, 2016 - 2:07 am UTC
thanks, Connor. I undestand what you have said. However, I never would have guessed on how to read "Parse CPU to Parse Elapsd %" and "Parse CPU to Parse Elapsd". I don't recall seeing statistics being represented that way. Let me add two examples to see if I get the formula.
We want these values to be close to 100%.
Example 1, if 99% of the time was spent on Parse CPU out of the 100% of Parse Elapsed, then the value is 99/100*100%= 99%. Okay, that one works out.
Example 2, if a SQL statement is executed 100 times but only parsed 10 times, then the value for "Execute to Parse" = 100/10*100%=1000%. Is that possible to get a value of 1000%?
why couldn't Oracle just broken those into readable statistics like:
time spent executing
time spent parsing
time spent on Parse CPU
time spent on Parse Elapsed
that would have made more sense to us than these "X to Y" and "Y to Z" statistics.
Thanks,
John
April 05, 2016 - 2:43 am UTC
execute to parse is calculated as = 1 - parse / execute
For example, on my just started db on the laptop, I run an AWR report and get:
Key Instance Activity Stats
execute: 7,072
parse count (total): 6,031
and hence at the top of the report I get:
Execute to Parse %: 14.72
Hope this helps.
John Cantu, April 05, 2016 - 3:12 pm UTC
Hi Connor,
thanks for providing the formula for "execute to parse %". That helped me to understand.
Let's put this into practice. In a database, I do have a value of .80% for "execute to parse %'. This is a terrible percentage, but in the case, it doesn't have a significant impact based on the time-model showing it using only .1 % of DB Time. However, if I did want to tune it, I would have to either move over to PL/SQL or I can increase "session_cached_cursors" from the default value, right?
I see that only about 10% of parses result in a session cursor cache hit.
Ex:
parse count total 371812
session cursor cache hits 31688
Thanks,
John
April 06, 2016 - 12:02 am UTC
Exactly. For me, anything that is a percentage is always just additive information rather than definitive information.
eg, You *drive* 100km from A to B and get red lights 50% of the time. I *walk* the same journet and get red lights 50% of the time.
For both of us, the red light percentage is 50%, but that tells me nothing about who got there faster.
DB Time, Waits and (most commonly) bad SQL....that's where I always focus.
"Parse CPU to Parse Elapsd %" Follow-up
John Cantu, April 06, 2016 - 1:14 pm UTC
Hi Connor,
Regarding the "Parse CPU to Parse Elapsd %" -
On one of the databases, I see a low value of 16.30%. This looks bad. However, if I compare that to "% Non-Parse CPU", that low value become insignificant, too. For "% Non-Parse CPU" I have a value of 99.98! That is great! Hence, only .02 % of CPU is spent parsing so it really doesn't matter what "% Non-Parse is" right?
Also, will you please provide the formula for "Parse CPU to Parse Elapsd %"?
I figured it would be: (1 - (100-% Non-Parse CPU) / "parse time elapsed % of DB Time)) * 100, but that doesn't add up to 16.30%
(1 - (.02/.1)) * 100 = 80%
Thanks,
John
April 07, 2016 - 1:38 am UTC
Down in "Instance Activity Stats" you will see:
parse time cpu
parse time elapsed
Those two figures provide the percentage.
Note - some OS's can capture cpu data versus elapsed data at *different* granularity, so its not uncommon to see CPU being *more* that elapsed, because one was (say) captured in centiseconds, the other in milliseconds etc.
So you might see percentages greater than 100
A reader, April 09, 2016 - 4:04 pm UTC
thanks, Connor.
the formula does add up:
parse time cpu / parse time elapsed = parse CPU to Parse Elapsd %
It is odd that in the case of "execute to parse %", the formula was different, "1 - parse / execute".
Thanks,
John