Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BF0D02E02FC for ; Tue, 5 Feb 2008 19:09:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 57707-10 for ; Tue, 5 Feb 2008 19:09:30 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D539B2E02F7 for ; Tue, 5 Feb 2008 19:09:28 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m15N9PTP029359; Tue, 5 Feb 2008 18:09:26 -0500 (EST) To: Kris Jurka cc: Arie Ozarov , pgsql-jdbc@postgresql.org Subject: Re: Performance comparison to psql. In-reply-to: References: Comments: In-reply-to Kris Jurka message dated "Tue, 05 Feb 2008 17:31:54 -0500" Date: Tue, 05 Feb 2008 18:09:25 -0500 Message-ID: <29358.1202252965@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/21 X-Sequence-Number: 18228 Kris Jurka 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