Skip site navigation (1) Skip section navigation (2)

Re: [Q] PDO use to bind arrays for insert

From: "V S P" <toreason(at)fastmail(dot)fm>
To: "Andrew McMillan" <andrew(at)morphoss(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: [Q] PDO use to bind arrays for insert
Date: 2008-11-17 04:26:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-php
thank you Andrew.

do you know if query planning happens only once
for the prepared Insert statements
where data is fed from within a client loop

 foreach ...
    execute prepared insert

and if it happens once -- is it on the first insert?

And the last question -- with pgpool
do prepared statements last between
different client connections?

that is If I have say apache setup with 5 processes
(and therefore PHP can be invoked within 5 worker processes

would the Prepared statements last across invocations

thank you

> Using the COPY functionality in PostgreSQL does save on parsing,
> although an insert of many rows in a single insert statement doesn't
> spend any significant amount of it's time parsing the input, and the
> query planning only happens once.
> If you are really concerned about the performance impacts of an insert,
> you might be better advised to feed the row data to a separate process
> which handled the actual inserts.
> > b) if it will work with PG connection pooling (which I am not
> > using yet, but will in the future).
> There's no reason why COPY shouldn't work with connection pooling,
> unless your connection pooling is trying to understand the statements
> deeply on the way through, without understanding PostgreSQL.  I can't
> think of why someone would write connection pooling that way though!
> Certainly it will work fine with pgpool, which is what I would recommend
> for connection pooling with PostgreSQL as it is written by someone on
> the core team.
> Cheers,
> 					Andrew McMillan.
  V S P

-- - Does exactly what it says on the tin

In response to


pgsql-php by date

Next:From: Andrew McMillanDate: 2008-11-17 08:26:42
Subject: Re: [Q] PDO use to bind arrays for insert
Previous:From: Andrew McMillanDate: 2008-11-17 04:05:47
Subject: Re: [Q] PDO use to bind arrays for insert

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group