Re: Performance comparison to psql.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Arie Ozarov <aozarov(at)hi5(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Performance comparison to psql.
Date: 2008-02-05 23:09:25
Message-ID: 29358.1202252965@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka <books(at)ejurka(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Toru SHIMOGAKI 2008-02-08 14:25:48 proposal: setKeepAlive
Previous Message Arie Ozarov 2008-02-05 23:09:07 Re: Performance comparison to psql.