Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 03EE82E3F7F for ; Tue, 5 Feb 2008 18:32:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 91093-05-2 for ; Tue, 5 Feb 2008 18:31:54 -0400 (AST) Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 3CCEB2E3EDE for ; Tue, 5 Feb 2008 18:31:56 -0400 (AST) Received: (qmail 8480 invoked by uid 1112); 5 Feb 2008 22:31:54 -0000 Date: Tue, 5 Feb 2008 17:31:54 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Arie Ozarov cc: pgsql-jdbc@postgresql.org Subject: Re: Performance comparison to psql. In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/20 X-Sequence-Number: 18227 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