Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 84AAF9FB3DF for ; Tue, 13 Mar 2007 09:40:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 70493-07 for ; Tue, 13 Mar 2007 09:40:46 -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.187]) by postgresql.org (Postfix) with ESMTP id 8006B9FB373 for ; Tue, 13 Mar 2007 09:40:51 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id x4so2497631nfb for ; Tue, 13 Mar 2007 05:40:49 -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=VKPb4WSrNtbWctC+PICbQleMwfBuIvxLMt5IpFdzcjVYXZTMLsd3Qdh1PBIPMy8WDcJhbXksKZV8Y2oZU3virBzREzJICLwfN2gW9xfuMd1eBcxJw3qvye80Cf+daiYmJSliYSP2PGGGxKQ6sGF9qwF+yhXPG60oni4d6EXVvE8= 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=XqjOCOD6cZyRtZnC3EhLXOUNZ8hjck344KpPcd0V/Nfn0OeYgIuuyErLf9Cz+83TKXPxGMLpVCXibHICTaDVXeP1VcO6jo6bHbR3Ke7aiVanwWIotTGkSPyGlS2PntsU1BhKRM2pLUTItFC9dVXk0LG6ft1j3mmStRkba6bG6ac= Received: by 10.78.200.3 with SMTP id x3mr277082huf.1173789649610; Tue, 13 Mar 2007 05:40:49 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Tue, 13 Mar 2007 05:40:49 -0700 (PDT) Message-ID: Date: Tue, 13 Mar 2007 07:40:49 -0500 From: "Merlin Moncure" 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/216 X-Sequence-Number: 23621 On 3/13/07, femski wrote: > > Folks ! > > 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. > > I have played with many parameters. Only one that seems to have any affect > is fsync - but thats only 10% or so. > Initially I got the warning that checkpoints were happening too often so I > increased the segments to 24. Warnings stopped, but no real improvement in > performance. > > Is postgres really that slow ? What am I missing ? how many inserts/sec are you getting approximately. Maybe you have some type of network issue. merlin