Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E3CE79FB94D for ; Sat, 17 Mar 2007 01:52:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 35703-06 for ; Sat, 17 Mar 2007 01:52:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by postgresql.org (Postfix) with ESMTP id B7E5E9FB659 for ; Sat, 17 Mar 2007 01:52:40 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id x4so499142nfb for ; Fri, 16 Mar 2007 21:52:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=J+XxX+3UjNTb0uwYwdIMDZYqV/mkxle6AYdNhIk8nBFJGoEeVngOjEZJiE72W1xHZ8dDBI64TMDqOQ20J806tSGhYWxPOTAB5zryy+ZbhfWzigSQJ5oBC/WeEkeoH/zhZEEGkK9iPBe6Gp4u5NySfZ5++x0jmqDZDKORnR6J03U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZLiC08UeO7uk/u3Ww63y+Uxqb4wi8iXV0y+ExwGK3PS/yHdrk3ajBgKYk5tlHTB7aAE/EAQfj/nrLnfvN2VkvUU+m9rk+WxvQxNAxxOQBQVTYIxukByol9Qc8cWZ8epFPUOtoq0WXcdqviLVOXoiFaluCJPLqpMtOsdAQVtRdW0= Received: by 10.82.153.5 with SMTP id a5mr4723356bue.1174107159628; Fri, 16 Mar 2007 21:52:39 -0700 (PDT) Received: by 10.49.93.15 with HTTP; Fri, 16 Mar 2007 21:52:39 -0700 (PDT) Message-ID: <9e4684ce0703162152u4abe97fcg64d0804f57ce95b1@mail.gmail.com> Date: Sat, 17 Mar 2007 05:52:39 +0100 From: "hubert depesz lubaczewski" To: femski Subject: Re: Postgres batch write very slow - what to do Cc: pgsql-performance@postgresql.org In-Reply-To: <9452092.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9452092.post@talk.nabble.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/262 X-Sequence-Number: 23667 On 3/13/07, femski wrote: > I have a batch application that writes approx. 4 million rows into a narrow > table. I am using JDBC addBatch/ExecuteBatch with auto commit turned off. > Batch size is 100. So far I am seeing Postgres take roughly five times the > time it takes to do this in the Oracle. you can try to use pg_bulkload. since it is called as standard function you shouldn't have problems with jdbc. and it's apparently fast. depesz http://pgfoundry.org/projects/pgbulkload/