Am 26.08.2011 05:30, schrieb mark:
>
>
> Hi all,
>
>
> I am trying to convince some of our php guys to not use prepared statements.
>
>
> The reason for this is, first reasons is we are seeing no benefit IMO.
> performance wise nearly all of the statements are being prepared, executed
> and then deallocated in nearly all cases. The other times it's probably only
> run twice so it's still not a win.
>
> The second reason is I want to be able to use transaction pooling with
> pgbouncer. This is the primary driving force.
--snip--
Well, in my systems I make the best of the forced prepare and use
my own cache of prepared statements in PHP. Statistics show that
some statements are repeated a lot, which might give a benefit in
speed.
And I am especially against connection pooling because it can
give you untraceable errors and just makes your systems more complex.
But if you want it: my first test had success. Just add
$DBH->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
after creating the connection, do not touch the connection string.
/Str