pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kris Jurka <books@ejurka.com>
Cc: Arie Ozarov <aozarov@hi5.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Performance comparison to psql.
Date: Tue, 05 Feb 2008 18:09:25 -0500
Message-ID: <29358.1202252965@sss.pgh.pa.us> (raw)
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>

Kris Jurka <books@ejurka.com> writes:
> 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.

Also, if you were inserting only one row per INSERT command, there's a
significant statement startup/shutdown overhead in the server, even for
a prepared statement.  I don't see any reason to think that these
numbers are JDBC's fault --- it's just a fact of life that COPY is
a lot more efficient than a series of INSERTs.  (If it were not, we'd
hardly even bother having it.)

			regards, tom lane



view thread (4+ messages)

Message-ID: <29358.1202252965@sss.pgh.pa.us>
Permalink:  ../29358.1202252965@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29358.1202252965@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, books@ejurka.com, aozarov@hi5.com
  Subject: Re: Performance comparison to psql.
  In-Reply-To: <29358.1202252965@sss.pgh.pa.us>
  References: <C3CE184C.E6B%aozarov@hi5.com> <Pine.BSO.4.64.0802051727210.12452@leary.csoft.net> <29358.1202252965@sss.pgh.pa.us>

* 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