|
|
| P is for Practical | |
| PerlMonks |
Re: $sth->prepare_cached loopby tilly (Archbishop) |
| on Mar 08, 2011 at 07:17 UTC ( #891960=note: print w/ replies, xml ) | Need Help?? |
|
What will happen will vary depending on the database. With Oracle, you will prepare the query once. And then send 3 execute statements to it. Which saves you the effort of compiling the query. Since compilation is expensive in Oracle, this is a win. In MySQL the caching is done client side. So you wind up preparing and executing the query 3 times. Since MySQL makes preparing the query cheap, this doesn't cost very much.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||