Scott Alexander wrote:

> I've been reading a document at
> http://www.saturn5.com/~jwb/dbi-performance.html
> by Jeffrey William Baker.
>
> And I have changed my perl code in one script to use placeholders and
> bound parameters.
>
> On my test server 500 mhz rh 7.1 128 MB I haven't noticed any speed
> differences. (/mysql/mysqladmin  Ver 8.21 Distrib 3.23.42, for
> pc-linux-gnu on i586)
>
> Can  mysql use placeholders ?
>
> In this script I have queries which only have one WHERE condition value,
> other queries have 3 WHERE condtion values. Is it better to
> use place holder in more complex queries?

Scott,

The only time you'll see a real performance increase is where you're repeadedly
calling execute() on the same statement handle with different values for the
placeholders - usually this occurs in a loop. This will save you having to do a
repeated prepare() - so the database server can reuse the old execution plan. Let
me know if you want a example.

~mark.




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to