Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DBDB69FB249 for ; Tue, 13 Mar 2007 12:56:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 05232-10 for ; Tue, 13 Mar 2007 12:56:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.189]) by postgresql.org (Postfix) with ESMTP id 274629FA4BB for ; Tue, 13 Mar 2007 12:56:10 -0300 (ADT) Received: by mu-out-0910.google.com with SMTP id g7so2606567muf for ; Tue, 13 Mar 2007 08:56:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=F5YSFwv9lZa7h/uqMMZvjQJBS3/VX9rYgb+Bi8ZSt/dt6cvqzWFT95cC9vQBOWS1uSbuXVAdOOnCFfeiIshFy5CUqcWWwzPymHCB12J+fk6c7ETBZt0dgpFFcjt4EsjvkeHV36P+a5fw1ExDIULWOMKBN841gfhS1aYeDFJQTms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=I2llKrV7SSnEIiff1+KiEucKgEaTJa+xG+nXcA9mz4lalJqNTH0VkESsTFgiHcYLjbyDeddKA8M2iRJsd+SfSEwZlDzzH1oxCw9TbqkJpDtQwJUlvaiFlXqqAtIwMRACcnfNTFaEIZhn8ECyASdN2SVRo33U8f9ZR1zkSCQDhAE= Received: by 10.82.111.8 with SMTP id j8mr1946223buc.1173801368893; Tue, 13 Mar 2007 08:56:08 -0700 (PDT) Received: from ?192.168.1.34? ( [82.3.248.145]) by mx.google.com with ESMTP id b30sm18168120ika.2007.03.13.08.56.06; Tue, 13 Mar 2007 08:56:07 -0700 (PDT) Message-ID: <45F6C99B.1080507@enterprisedb.com> Date: Tue, 13 Mar 2007 15:56:11 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.8 (X11/20061116) MIME-Version: 1.0 To: Tom Lane CC: femski , pgsql-performance@postgresql.org Subject: Re: Postgres batch write very slow - what to do References: <9452092.post@talk.nabble.com> <45F685B7.5040001@enterprisedb.com> <9453712.post@talk.nabble.com> <2563.1173799749@sss.pgh.pa.us> In-Reply-To: <2563.1173799749@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/232 X-Sequence-Number: 23637 Tom Lane wrote: > It sounds like you're incurring a network round trip for each row, which > will be expensive even for a co-located application. Perhaps Oracle's > JDBC driver is smart enough to avoid that. I'm not sure what tricks are > available for bulk loading with our JDBC driver --- the page Heikki > mentioned explains things from a server perspective but I dunno how that > translates into JDBC. The folks who hang out on pgsql-jdbc could > probably give you some tips. OP said he's using addBatch/executeBatch with a batch size of 100. The JDBC driver sends the whole batch before waiting for responses. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com