MySQL 4.0x doesn't support prepared queries, so they're emulated. Emulation means hanging on to the query, and expanding the '?' markers at
execute time, substituting appropriately quoted values. However, this isn't a heavyweight operation, particularly not when compared with the overhead of shipping the query over the wire to the server, and waiting for the server to crank on it and return a result.
Assuming (and we have to assume, since we haven't seen code yet, and what we have been shown doesn't verify that results are identical) that query that arrives at the database server process is identical in either case, and assuming that a standalone (non-mod_perl) test doesn't show the the same disparity in timing, then something underneath bind_param is interacting with mod_perl. On a light read of DBD.pm and DBI::MySQL.pm, I can't see what that would be. Curious.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.