Thursday, January 3, 2013

Interpret the statistics


        149  recursive calls
          1  db block gets
       1921  consistent gets
          0  physical reads
          0  redo size
        368  bytes sent via SQL*Net to client
        425  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          4  sorts (memory)
          0  sorts (disk)
          1  rows processed
 
These are the keywords that help us understand how was it in reality that Oracle returned us the results it did when we issued a query. 

"recursive calls"
IT toolbox link takes an analogy of ordering a pizza.

Where in turn the kitchen is called to cook, cashier is called to bill and delivery boy called to deliver all calls in turn that are trying to achieve the objective.
The important part to note is "many recursive calls could be indicative of a problem (incorrect size of dictionary cache for eg.)"
But "not all calls are bad".

Instance the PL/SQL example where the procedure could be doing few (Say 10) DML inserts, so one call to the procedure may be fulfilled with 10 recursive calls. a 1:10 ratio which is not necessarily bad as we know the inserts were intended only.
Read more about them to get detailed understanding. This is not a great start here but still worth a read.

"db block gets" and "consistent gets"
 
ORA FAQ link has a dig at the above 2.
 
Also in below link is the crux of these 2 stats 
http://mwidlake.wordpress.com/2009/06/02/what-are-consistent-gets/
- Recursive calls was from parsing.
- Consistent Gets was reads from memory (sga).
{and then came the stumble}
- DB_Block Gets was physical reads from the I/O subsystem.
No, that’s wrong. I corrected myself and said
- Physical Reads is physical reads from the I/O subsystem.

I am not sure if the audience noticed, but I paused and internally I had a private conversation – “What are DB Block gets? I know consistent gets are gets from the block buffer cache. What is the difference? What in hell am I talking about?”

I did what you have to try and do when you hit a moment like that when presenting and kept going. {If the confusion gelled in my head I would go back and explain. If it did not gel, I’d risk experts knowing I had messed up for the sake of a smooth presentation}. It didn’t gel. I finished the presentation, went home and I looked at it. And was vexed.

"physical reads"

"redo size"

and "sorts"

No comments:

Post a Comment