pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Arie Ozarov <aozarov@hi5.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Performance comparison to psql.
Date: Tue, 5 Feb 2008 17:31:54 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0802051727210.12452@leary.csoft.net> (raw)
In-Reply-To: <C3CE184C.E6B%aozarov@hi5.com>
References: <C3CE184C.E6B%aozarov@hi5.com>



On Tue, 5 Feb 2008, Arie Ozarov wrote:

> I understand that JDBC has some overhead (object translation,..) but didn't
> think the difference would be that big. Do this numbers look correct (any
> optimization suggestion?)

The real cost is the protocol level overhead of INSERT vs COPY.  JDBC 
batch execution groups things together to reduce the number of network 
round trips, but it still has to send each insert as an individual request 
to the server.

> Any performance improvement in postgresql-8.2-507.jdbc4.jar?
>

No.

> Is the copy operation much more optimized than inserts (and if so when/will
> the driver support it)?
>

Yes, copy is significantly faster than insert.  If you'd like, construct a 
psql test case that does 100,000 individual inserts and you'll see it's 
not just a JDBC driver/libpq difference.

Copy support is available using this patched driver, but it has not been 
integrated into the official version yet.

http://kato.iki.fi/sw/db/postgresql/jdbc/copy/

Kris Jurka




view thread (4+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0802051727210.12452@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0802051727210.12452@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0802051727210.12452@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, aozarov@hi5.com
  Subject: Re: Performance comparison to psql.
  In-Reply-To: <Pine.BSO.4.64.0802051727210.12452@leary.csoft.net>
  References: <C3CE184C.E6B%aozarov@hi5.com> <Pine.BSO.4.64.0802051727210.12452@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox