Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id BD3ED9FB314 for ; Fri, 20 Apr 2007 10:23:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 90237-01 for ; Fri, 20 Apr 2007 10:22:58 -0300 (ADT) X-Greylist: delayed 00:30:22.636768 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id EA99F9FB53C for ; Fri, 20 Apr 2007 10:23:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from eppesuigoccas.homedns.org (unknown [82.52.148.108]) by svr4.postgresql.org (Postfix) with ESMTP id 0CAA85AF02D for ; Fri, 20 Apr 2007 12:52:36 +0000 (GMT) Received: from eppesuig3wifi ([192.168.2.51] helo=localhost) by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HesU8-0001YA-11 for pgsql-jdbc@postgresql.org; Fri, 20 Apr 2007 14:45:08 +0200 Received: from giuseppe by localhost with local (Exim 4.63) (envelope-from ) id 1Hesdf-0003OY-Oc for pgsql-jdbc@postgresql.org; Fri, 20 Apr 2007 14:54:59 +0200 Subject: Re: Poor addBatch performance. Why dosn't it use copy ? From: Giuseppe Sacco To: pgsql-jdbc@postgresql.org In-Reply-To: <1177069985.5343.33.camel@scarafaggio> References: <10099075.post@talk.nabble.com> <1177069985.5343.33.camel@scarafaggio> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Lixper S.r.L. Date: Fri, 20 Apr 2007 14:54:59 +0200 Message-Id: <1177073699.5343.45.camel@scarafaggio> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200704/75 X-Sequence-Number: 16924 [send post, since the first one was rejected by MTA] Hi femski, Il giorno ven, 20/04/2007 alle 04.39 -0700, femski ha scritto: [...] > Why doesn't the Postgres JDBC driver use "copy" for faster bulk insert ? > What is the best way to speedup > do bulk insert at this time or in near future (I was to use standard JDBC > API) ? I use addBatch() very often when, but I use it with statement that work on different tables. I think it would really be difficult to check if the statements are referring the same table and the same field. Why don't you write all record in one insert statement like "INSERT INTO table (fields) VALUES (...,...), (...,...), (...,..);" I think both oracle and postgres 8.2 should accept this syntax. Bye, Giuseppe