Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A11E29FBA90 for ; Thu, 15 Mar 2007 08:52:59 -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 97868-04 for ; Thu, 15 Mar 2007 08:52:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by postgresql.org (Postfix) with ESMTP id BB57E9FB864 for ; Thu, 15 Mar 2007 08:52:54 -0300 (ADT) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HRoVp-0000jm-BL for pgsql-performance@postgresql.org; Thu, 15 Mar 2007 04:52:53 -0700 Message-ID: <9492938.post@talk.nabble.com> Date: Thu, 15 Mar 2007 04:52:53 -0700 (PDT) From: femski To: pgsql-performance@postgresql.org Subject: Re: Postgres batch write very slow - what to do In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: hypertree@yahoo.com References: <9452092.post@talk.nabble.com> <45F685B7.5040001@enterprisedb.com> <9453712.post@talk.nabble.com> <9473692.post@talk.nabble.com> <9486986.post@talk.nabble.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/247 X-Sequence-Number: 23652 I tried maxpages = 0 and full_page_writes=off and it seemed to be taking forever. All other tricks I have already tried. At this point I wondering if its a jdbc client side issue - I am using the latest 8.1. (as I said in an earlier post - I am using addBatch with batch size of 100). But just in case - I am missing something. If 17k record/sec is right around expected then I must say I am little disappointed from the "most advanced open source database". thanks for all your help. -Sanjay Merlin Moncure-2 wrote: > > On 3/15/07, femski wrote: > well, what sql is the jdbc driver creating exactly? It is probably > running inserts in a transaction. your load is about 17k inserts/sec > which about right for postgres on your hardware. you have the > following options to play increase insert performance: > > * tweak postgresql.conf > fsync: off it is not already > wal_segments: bump to at least 24 or so > maintenance_work_mem: if you create key after insert, bump this high > (it speeds create index) > bgwriter settings: you can play with these, try disabling bgwriter > first (maxpages=0) > full_page_writes=off might help, not 100% sure about this > > * distribute load > make load app multi thrreaded. > > * use copy for bulk load > [is there a way to make jdbc driver do this?] > > * use multi-line inserts (at least 10 rows/insert)...nearly as fast as > copy > > * if jdbc driver is not already doing so, prepare your statements and > execute. > > merlin > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > -- View this message in context: http://www.nabble.com/Postgres-batch-write-very-slow---what-to-do-tf3395195.html#a9492938 Sent from the PostgreSQL - performance mailing list archive at Nabble.com.