pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: itb348@googlemail.com
To: pgsql-php@postgresql.org
Subject: Re: pdo emulate prepares not working. still getting parse-bind-execute-deallocate in pg log.
Date: Fri, 26 Aug 2011 12:42:03 +0200
Message-ID: <4E57787B.7060909@googlemail.com> (raw)
In-Reply-To: <000401cc63a0$7e3bd7b0$7ab38710$@com>
References: <000401cc63a0$7e3bd7b0$7ab38710$@com>

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



view thread (3+ messages)  latest in thread

Message-ID: <4E57787B.7060909@googlemail.com>
Permalink:  ../4E57787B.7060909@googlemail.com/
Also on:    postgresql.org/message-id/4E57787B.7060909@googlemail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: itb348@googlemail.com
  Subject: Re: pdo emulate prepares not working. still getting parse-bind-execute-deallocate in pg log.
  In-Reply-To: <4E57787B.7060909@googlemail.com>
  References: <000401cc63a0$7e3bd7b0$7ab38710$@com> <4E57787B.7060909@googlemail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox