[Dbix-class] Turning off prepared statements for LIKE searches

Jacob Bunk Nielsen bunk at novozymes.com
Thu Aug 20 13:44:53 GMT 2009


Hi

I have read an interesting blog post about how prepared statements in
PostgreSQL does not work well with LIKE searches. It can be found at:
http://blog.endpoint.com/2009/08/debugging-prepared-statements.html

I'm hit by this in several places in my code. I have an example where I
can go from ~290 ms to 0.5 ms for a single query, so quite a significant
improvement, that I'd like to benefit from.

Of course I'm using DBIx::Class, so my question is how do I turn off
prepared statements for LIKE searches?

I think I'd like to be able to turn off prepared statements everywhere I
use LIKE. If that is not what I want, please tell me why :-)

Can anyone give my a clue as to how I would go about not using prepared
statements for LIKE searches and still staying with DBIx::Class?

Best regards

Jacob



More information about the DBIx-Class mailing list