P is for Practical | |
PerlMonks |
Re: Re: Re: performance problem with oralce dbdby tilly (Archbishop) |
on Apr 16, 2004 at 05:48 UTC ( [id://345649]=note: print w/replies, xml ) | Need Help?? |
Oracle in particular does not do well with hard parses. Convert your query to use placeholders (ie pass in ? for each parameter, and then in the execute pass in the data) and performance should improve greatly. More importantly if load matters, hard parses use a type of internal lock known as a latch, and latch contention will cause Oracle to scale very poorly. Of course prepare_cached with placeholders will perform even better, but just switching to placeholders will make Oracle perform much better. To understand Oracle's performance characteristics, I can highly recommend virtually anything by Tom Kyte. He has strong opinions on how to use Oracle (some of which I disagree with) but does a very good job of explaining how things work and giving you the tools to explore further. UPDATE: As noticed by jplindstrom and etcshadow, I misread the code and the hard parses issue that I talked about is indeed a red herring. However if you are benchmarking, be aware that if the real code does not use placeholders, then hard parses will be a problem for the database, and you really want to avoid them.
In Section
Seekers of Perl Wisdom
|
|