Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z1JRn-0004Rx-4G for pgsql-jdbc@arkaria.postgresql.org; Sat, 06 Jun 2015 19:07:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z1JRl-0003oG-QR for pgsql-jdbc@arkaria.postgresql.org; Sat, 06 Jun 2015 19:07:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z1JRl-0003oA-3Q for pgsql-jdbc@postgresql.org; Sat, 06 Jun 2015 19:07:57 +0000 Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z1JRh-00024b-G8 for pgsql-jdbc@postgresql.org; Sat, 06 Jun 2015 19:07:56 +0000 Received: by pdjm12 with SMTP id m12so73581216pdj.3 for ; Sat, 06 Jun 2015 12:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+m2VRNHS/k7esNxdL7OHCAU9CpDAZBigRZ0Gg65kvNI=; b=GAbvPATqdK2VBhvjf83wiEA1fJnDryItRK6DmV94t6MlvHyY6L8FAxWeaxwFhRUFAr jsZY3I9EcrE7N1g7JA2z2q0+G209/SGaKpT1HGhZFU2INyXt3moGOO3XJ/TtkpeTZgD6 wBkAbz0stOhqagnXfXvHZnY39U2sFIWIvPevyghLXfB/l5UiThEchQUnVOn+nVlTzLTM vHVWeKLXn67VufM1ex1GbcxY38YVgV17SMa/vjSQ6UFe1JxWyBJPOZPW0E/odJC39MLP HeMqCM8pglJ9rtlX8AT6FAc0Y9S1RF8D+UCvEQlQMSfdE1jOMsDDoLuzkAVyvIdUmGSC I/Dg== X-Received: by 10.68.245.67 with SMTP id xm3mr15904095pbc.45.1433617670609; Sat, 06 Jun 2015 12:07:50 -0700 (PDT) Received: from [192.168.1.6] (c-73-25-229-72.hsd1.or.comcast.net. [73.25.229.72]) by mx.google.com with ESMTPSA id oo3sm10375034pac.31.2015.06.06.12.07.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 06 Jun 2015 12:07:49 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-CE38BE5E-D57E-4850-BE79-4CD17EA8E60C Mime-Version: 1.0 (1.0) Subject: Re: Multiple Row Insert vs. Batch From: Robert DiFalco X-Mailer: iPhone Mail (12F70) In-Reply-To: Date: Sat, 6 Jun 2015 12:07:47 -0700 Cc: Vitalii Tymchyshyn , List Content-Transfer-Encoding: 7bit Message-Id: <33CACA06-F1A0-466B-B985-D33ACA15A984@gmail.com> References: To: Dave Cramer X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --Apple-Mail-CE38BE5E-D57E-4850-BE79-4CD17EA8E60C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Yes that's correct. A multiple row insert with a single insert statement. I'= ll try benchmarking the two on Monday. My guess is that they are pretty damn= similar.=20 Sent from my iPhone > On Jun 6, 2015, at 10:35 AM, Dave Cramer wrote: >=20 > Robert ?? >=20 > Is that what you meant ? >=20 > Dave Cramer >=20 > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca >=20 >> On 6 June 2015 at 13:34, Vitalii Tymchyshyn wrote: >> I think OP meant something like >> Insert into table values (?,?,?),(?,?,?),...,(?,?,?); >> Vs batch of insert into table values(?,?,?); >>=20 >> I really think first would be faster up to a certain amount of rows, but t= est is needed to check. >>=20 >> Vitalii Tymchyshyn >>=20 >> =D0=A1=D0=B1, 6 =D1=87=D0=B5=D1=80=D0=B2. 2015 13:30 Dave Cramer =D0=BF=D0=B8=D1=88=D0=B5: >>=20 >>> batch should be faster and if it isn't we did something wrong >>>=20 >>> Dave Cramer >>>=20 >>> dave.cramer(at)credativ(dot)ca >>> http://www.credativ.ca >>>=20 >>>> On 6 June 2015 at 12:34, Robert DiFalco wrot= e: >>>> Say I need to insert 250 rows. Is single-statement multiple row insert o= r JDBC batch likely to be faster? >>>>=20 >>>> Thanks! >>>>=20 >>>> R. >=20 --Apple-Mail-CE38BE5E-D57E-4850-BE79-4CD17EA8E60C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Yes that's correct. A multiple row ins= ert with a single insert statement. I'll try benchmarking the two on Monday.= My guess is that they are pretty damn similar. 

Sent from my iP= hone

On Jun 6, 2015, at 10:35 AM, Dave Cramer <pg@fastcrypt.com> wrote:

Robert ??

Is that what you meant ?

Dav= e Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 6 June 2015 at 13:34, Vitalii Tymchyshyn <= span dir=3D"ltr"><vit@tym= .im> wrote:

I t= hink OP meant something like
Insert into table values (?,?,?),(?,?,?),...,(?,?,?);
Vs batch of insert into table values(?,?,?);

I really think first would be faster up to a certain amount o= f rows, but test is needed to check.

Vitalii Tymchyshyn


=D0=A1=D0=B1, 6 =D1=87=D0=B5=D1=80=D0=B2. 201= 5 13:30 Dave Cramer <pg@fastcrypt.com> =D0=BF=D0=B8=D1=88=D0=B5:

batch should be faste= r and if it isn't we did something wrong
Dave Cramer

dave.cramer(at)credativ(dot)cahttp://www.credativ.c= a

On 6 June 2015 at 12:34, Robert DiFalco <robert.difalco@gmail.com> wrote:
Say I need to insert 250 rows. Is single-statement m= ultiple row insert or JDBC batch likely to be faster?

Tha= nks!

R.
<= /span>


= --Apple-Mail-CE38BE5E-D57E-4850-BE79-4CD17EA8E60C--