Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 19D2965017B for ; Mon, 17 Nov 2008 00:32:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41165-01-9 for ; Mon, 17 Nov 2008 00:32:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mail.postgresql.org (Postfix) with ESMTP id 080F5650429 for ; Mon, 17 Nov 2008 00:26:58 -0400 (AST) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 3A7061B72A0; Sun, 16 Nov 2008 23:26:58 -0500 (EST) Received: from web5.messagingengine.com ([10.202.2.214]) by compute1.internal (MEProxy); Sun, 16 Nov 2008 23:26:58 -0500 Received: by web5.messagingengine.com (Postfix, from userid 99) id 1DC68258AD; Sun, 16 Nov 2008 23:26:58 -0500 (EST) Message-Id: <1226896018.14093.1285127497@webmail.messagingengine.com> X-Sasl-Enc: FsCWY95LctzewfE8joprQhDFM70JpcXMkl1KedmGbpBH 1226896018 From: "V S P" To: "Andrew McMillan" Cc: pgsql-php@postgresql.org Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="KOI8-R" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface References: <1226803530.24888.1284994985@webmail.messagingengine.com> <492093A5.7040606@gmail.com> <20081117002630.d86160fd.knl@bitflop.com> <1226890873.32288.1285117971@webmail.messagingengine.com> (sfid-20081117_160220_914818_FB8966C0) <1226894747.5577.267.camel@happy.mcmillan.net.nz> Subject: Re: [Q] PDO use to bind arrays for insert In-Reply-To: <1226894747.5577.267.camel@happy.mcmillan.net.nz> Date: Sun, 16 Nov 2008 23:26:58 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200811/15 X-Sequence-Number: 3926 Hi, 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 end 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 simultaneously) 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 toreason@fastmail.fm -- http://www.fastmail.fm - Does exactly what it says on the tin