Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0DAB29FB974 for ; Thu, 21 Jun 2007 17:09:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 36668-03-2 for ; Thu, 21 Jun 2007 17:09:30 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.227]) by postgresql.org (Postfix) with ESMTP id CB1EF9FB971 for ; Thu, 21 Jun 2007 17:09:32 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id s16so573463wxc for ; Thu, 21 Jun 2007 13:09:31 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=TOrYAlkV5C3W+CUJFNLvypKMuSW7nw5htUqWOLlarSrIyVrcnACyouE5POc1IBhmf/Y/6p/1lBUmpjbse1yODWPQ8G4TdSA6oxdj0XH/H8HO46IzTmmmEEXnyP153bk0tunNhDvrDDITQ25CX4gHOwlDVeyrMjqEc8kioMt0b/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Q6w2xPFPTQM7GX/lG0QNtNJgSMAralTDOrbbEcmkBJovbp0eECfQO+zhcaS6STO1Bz+ZxNTVVRghUACZmArlGihy3eqyo5qyf96cViGkR/cN2ghi8s8Cc8F7euv0AJLMRRIzfp5Yc8wt+Uddav1bjHYDPlRxX5AUSZc+EoY/ZPc= Received: by 10.70.67.2 with SMTP id p2mr3523866wxa.1182456571131; Thu, 21 Jun 2007 13:09:31 -0700 (PDT) Received: by 10.70.109.14 with HTTP; Thu, 21 Jun 2007 13:09:31 -0700 (PDT) Message-ID: <357fa7590706211309w3bc072s321e546f4c5fd976@mail.gmail.com> Date: Thu, 21 Jun 2007 16:09:31 -0400 From: "Steven Flatt" To: "Andreas Kretschmer" Subject: Re: Very long SQL strings Cc: pgsql-performance@postgresql.org In-Reply-To: <20070621184833.GA10814@KanotixBox> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_109169_251907.1182456571099" References: <357fa7590706211133u2ae43d09id1653ca63d7a7838@mail.gmail.com> <20070621184833.GA10814@KanotixBox> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/490 X-Sequence-Number: 25523 ------=_Part_109169_251907.1182456571099 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks everyone for your responses. I don't think it's realistic to change our application infrastructure to use COPY from a stream at this point. It's good to know that multi-row-VALUES is good up into the thousands of rows (depending on various things, of course). That's a good enough answer for what I was looking for and we can revisit this if performance does start to hurt. On 6/21/07, Andreas Kretschmer wrote: > > I guess you can obtain the same if you pack all INSERTs into one > transaction. Well the 20% gain I referred to was when all individual INSERTs were within one transaction. When each INSERT does its own commit, it's significantly slower. Steve ------=_Part_109169_251907.1182456571099 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks everyone for your responses.  I don't think it's realistic to change our application infrastructure to use COPY from a stream at this point.  It's good to know that multi-row-VALUES is good up into the thousands of rows (depending on various things, of course).  That's a good enough answer for what I was looking for and we can revisit this if performance does start to hurt.

On 6/21/07, Andreas Kretschmer <akretschmer@spamfence.net> wrote:
I guess you can obtain the same if you pack all INSERTs into one
transaction.
 
Well the 20% gain I referred to was when all individual INSERTs were within one transaction.  When each INSERT does its own commit, it's significantly slower.
 
Steve
 
------=_Part_109169_251907.1182456571099--