Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> JDBC,soft and hard parses, hit ratios
I noticed something alarming in my database last week.
During a scalability test, I doubled the size of a batch job and ended
up with a fragmented shared pool. Could of just made the pool bigger,
but noticed that THOUSANDS of sql statements called with a JDBC thin
driver were not using bind variables and were highly repetitive.
Such as
delete from tablex where id = 5
delete from tablex where id = 6
...hundreds more
etc.,
Sent back a request to the developers that they rework things to use
bind variables (which I got the impression was a little involved..
anyone care to comment on that?).. so that we could keep a nice and
tidy shared pool.
But.. it got me thinking about parsing in general. If someone is not using a bind variable, it is a hard parse every time a statement rolls through, is that right?
If someone is using a bind variable, then it is a hard parse the first time the statemnet is parsed, and a soft parse each time thereafter as long as the statement remains in the pool.. is that right?
So.. what I was wondering, other than the other questions above, is whether a soft parse counts against by hit ratios (library cache.. ). I would think it doesn't, as I would imagine a statement using a bind variable would be a hit, or a pin hit, or would it not? I find it a little hard to swallow with so many tuned up databases reporting hit ratios of .99, .98 etc., that the statements are identical in form and data, so I'm guessing a soft parse with different variables inserted in them is a hit.. Am I right? Clearly..I'm not sure...
Thanks for any help,