Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0F030633165 for ; Wed, 18 Feb 2009 13:29:57 -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 30327-08 for ; Wed, 18 Feb 2009 13:29:44 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mail.postgresql.org (Postfix) with ESMTP id 922EE63317C for ; Wed, 18 Feb 2009 13:29:43 -0400 (AST) Received: by qw-out-2122.google.com with SMTP id 5so823258qwd.61 for ; Wed, 18 Feb 2009 09:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=tpggXfMwKs7bn0EHnZ90hEL73g3LYpcRUp8INVs7ewk=; b=Rwjo/sBKhLb9PNJyJkY4uUyfpjSrFsolsXo81KNrXlTcnD18jHJN9A9Vausw+mt6zQ VZO6QMfmF8YNOzp1ZHR5GuavrxHgeu277FoVzzqWH4a1TETEWDTswuEHZPnprUuh55pV gRnynTuDvOOfQeg0Mz4Sqa/KDuAyj9q8yvr6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Imqs3IXkviTqAWqmW4nzHTgW91L/mvdyRkQp65H99VNk2ZAt7dojjhtidq+RcKViE/ osUWtpAram92OTR7E9rp4cRHwJ7UANcaYLcyfqW1iBqUM32RZ/oY0g5NNwmeUqgvz8Nd uXRwokgaPItcoW+GAl4xtrP+I1jYECk433DJ8= MIME-Version: 1.0 Received: by 10.229.110.21 with SMTP id l21mr1475803qcp.26.1234978179206; Wed, 18 Feb 2009 09:29:39 -0800 (PST) In-Reply-To: References: Date: Wed, 18 Feb 2009 12:29:39 -0500 X-Google-Sender-Auth: 049d35fc704be158 Message-ID: <491f66a50902180929x3d9e89f2u3a13b88eecbcb588@mail.gmail.com> Subject: Re: Performance of jdbc insert statements and select nextval From: Dave Cramer To: ralf.baumhof@bgs-ag.de Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016361e8252ad500b046334c349 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.52 tagged_above=0 required=5 tests=HTML_IMAGE_ONLY_28=1.519, HTML_MESSAGE=0.001 X-Spam-Level: * X-Archive-Number: 200902/25 X-Sequence-Number: 19300 --0016361e8252ad500b046334c349 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We would probably have to see the code to understand the problem better. Dave On Wed, Feb 18, 2009 at 10:25 AM, wrote: > > i found the following problem: > > 10000 inserts with pgadmin tool into one table (primary key bigserial) ca= n > be done wihtin 3 seconds. If i perform the same job with jdbc this takes = 13 > seconds. The insert statement is prepared only once, the statement for > fetching the nextval also. If i omit the select nextval execution time > improves to 8 seconds. Can anybody tell me why jdbc is 3 to four times > slower than pgadmin? I am using Postgresql 8.2 and 8.3 Database server, j= ava > 1.5 and 1.6 and i tried the drivers 8.2 and 8.3 in type 3 and type 4. The > execution times are always identical. > > thanks, Ralf > ------------------------------ > BGS Beratungsgesellschaft > Software Systemplanung AG *Niederlassung Nord* > Ebertstra=DFe 21 > 26382 Wilhelmshaven > Fon: +49 (0) 4421 / 9683-700 > Fax: +49 (0) 4421 / 9683-790 > www.bgs-ag.de *Gesch=E4ftssitz Mainz* > *Registergericht* > Amtsgericht Mainz > HRB 62 50 > *Aufsichtsratsvorsitzender* > Klaus Hellwig > *Vorstand* > Hanspeter Gau > Hermann Kiefer > Nils Manegold [image: BGS Systemplanung AG] > > [image: Ein Unternehmen der nextevolution consulting group] --0016361e8252ad500b046334c349 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We would probably have to see the code to understand the problem better.
Dave

On Wed, Feb 18, 2009 at 10:25 A= M, <ralf.ba= umhof@bgs-ag.de> wrote:

i found the following problem:

10000 inserts with pgadmin = tool into one table (primary key bigserial) can be done wihtin 3 seconds. If i perfor= m the same job with jdbc this takes 13 seconds. The insert statement is prepa= red only once, the statement for fetching the nextval also. If i omit the selec= t nextval execution time improves to 8 seconds. Can anybody tell me why jdbc is  3 to four times slower than pgadmin? I am using Postgresql 8.2 and 8.3 Database server, java 1.5 and 1.6 and i tried the drivers 8.2 and 8.3 in type 3 and type 4. The execution times are always identical. =

thanks, Ralf
BGS Beratungsgesellscha= ft
Software Systemplanung AG
     
  Niederlassung NordEbertstra=DFe 21
26382 Wilhelmshaven
Fon: +49 (0) 4421 / 9683-700Fax: +49 (0) 4421 / 9683-790
www.bgs-ag.de
Gesch=E4ftssitz Mainz
Registergericht
Amtsgericht Mainz
HRB 62 50
 
Aufsichtsratsvorsitzende= r
Klaus Hellwig
Vorstand
Hanspeter Gau
Hermann Kiefe= r
Nils Manegold
3D"BGS

&nbs= p;3D"Ein=

--0016361e8252ad500b046334c349--