Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 278C66503F0 for ; Mon, 17 Nov 2008 00:20:39 -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 37244-04-7 for ; Mon, 17 Nov 2008 00:20:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.morphoss.com (hoppy.mcmillan.net.nz [202.78.240.82]) by mail.postgresql.org (Postfix) with ESMTP id AA9EE65008C for ; Mon, 17 Nov 2008 00:05:53 -0400 (AST) Received: from [IPv6:2404:130:b055:0:215:afff:fe48:6c48] (unknown [IPv6:2404:130:b055:0:215:afff:fe48:6c48]) by mail.morphoss.com (Postfix) with ESMTPS id 5035522F33; Mon, 17 Nov 2008 17:05:48 +1300 (NZDT) Subject: Re: [Q] PDO use to bind arrays for insert From: Andrew McMillan To: V S P Cc: pgsql-php@postgresql.org In-Reply-To: <1226890873.32288.1285117971@webmail.messagingengine.com> (sfid-20081117_160220_914818_FB8966C0) 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) Content-Type: text/plain Date: Mon, 17 Nov 2008 17:05:47 +1300 Message-Id: <1226894747.5577.267.camel@happy.mcmillan.net.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/14 X-Sequence-Number: 3925 On Sun, 2008-11-16 at 22:01 -0500, V S P wrote: > > I think Chris @ dmagick pointed to a raw string functionality > that -- so I will need to figure out if > a) it actually saves on parsing 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. ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64(272)DEBIAN You have a deep interest in all that is artistic. ------------------------------------------------------------------------