Skip site navigation (1) Skip section navigation (2)

Re: Performance of jdbc insert statements and select nextval

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: ralf(dot)baumhof(at)bgs-ag(dot)de
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Performance of jdbc insert statements and select nextval
Date: 2009-02-18 17:29:39
Message-ID: 491f66a50902180929x3d9e89f2u3a13b88eecbcb588@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
We would probably have to see the code to understand the problem better.

Dave

On Wed, Feb 18, 2009 at 10:25 AM, <ralf(dot)baumhof(at)bgs-ag(dot)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 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, 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 Beratungsgesellschaft
> Software Systemplanung AG          *Niederlassung Nord*
> Ebertstra├če 21
> 26382 Wilhelmshaven
> Fon: +49 (0) 4421 / 9683-700
> Fax: +49 (0) 4421 / 9683-790
> www.bgs-ag.de *Gesch├Ąftssitz Mainz*
> *Registergericht*
> Amtsgericht Mainz
> HRB 62 50
>   *Aufsichtsratsvorsitzender*
> Klaus Hellwig
> *Vorstand*
> Hanspeter Gau
> Hermann Kiefer
> Nils Manegold [image: BGS Systemplanung AG] <http://www.bgs-ag.de>
>
>  [image: Ein Unternehmen der nextevolution consulting group]<http://www.nextevolution.de>

In response to

pgsql-jdbc by date

Next:From: abdi indraDate: 2009-02-19 03:27:45
Subject: please help
Previous:From: ralf.baumhofDate: 2009-02-18 15:25:05
Subject: Performance of jdbc insert statements and select nextval

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group