Is there appreciable overhead in just preparing each statement as it's built and only using it once? This would still allow binding of the parameters, to avoid the quoting quagmire. Obviously there are performance gains in re-using prepared statements. But it seems to me that a good first step is to just change the method by which each query is executed, then worry about how to cache statement handles.

Aaron Stone wrote:
On Fri, 2006-06-16 at 12:12 -0500, Jim C. Nasby wrote:

Can you provide some examples? I can't think of any reason why any query
couldn't use bound parameters, though of course if they're highly
customized you won't see a performance benefit from them...

Take a look at db_imap_utf7_like in db.c, for example. It would probably
be possible to rewrite this as a prepared statement, because it always
has either one or two LIKE's, but the search/sort stuff is much worse
and builds the query from a very variable number of parameters. See
dbmail-mailbox.c.

Aaron

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to