Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4D8F3475B2F for ; Fri, 2 Aug 2002 14:41:48 -0400 (EDT) Received: from mta4.snet.net (mta4.snet.net [204.60.203.76]) by postgresql.org (Postfix) with ESMTP id B5A00475AB4 for ; Fri, 2 Aug 2002 14:41:47 -0400 (EDT) Received: from pop.snet.net (pop.snet.net [204.60.203.72]) by mta4.snet.net (8.12.3/8.12.3/SNET-mx-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g72IfRIN000713; Fri, 2 Aug 2002 14:41:27 -0400 (EDT) X-Originating-IP: [64.252.95.167] X-SBCIS-MTA: [pop.snet.net] Received: from [192.168.1.83] (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.3/8.12.3/SNET-pop-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id g72IfaT0007252; Fri, 2 Aug 2002 14:41:37 -0400 (EDT) Subject: Re: Seeking advice regarding a design problem From: Wei Weng To: Stephan Szabo Cc: pgsql-sql@postgresql.org In-Reply-To: <20020802112052.Y41371-100000@megazone23.bigpanda.com> References: <20020802112052.Y41371-100000@megazone23.bigpanda.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 02 Aug 2002 14:41:36 -0400 Message-Id: <1028313697.9763.45.camel@Monet> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/43 X-Sequence-Number: 8889 On Fri, 2002-08-02 at 14:24, Stephan Szabo wrote: > On 2 Aug 2002, Wei Weng wrote: > > > I am running postgresql as database backend, and I have some scripts > > dealing with constant incoming data and then insert these data into the > > database, in a quite complex way, involving a couple of procedures. > > > > But the performance of the database is worse than I had thought. After > > about 100 times of the script being run, the speed of the insertion > > slowed down dramatically. But it went back to the regular fast speed > > after I did a vacuum analyze. > > > > how can I redesign the system to avoid the bottleneck? And why is it > > Upgrade to 7.2 so that you can vacuum while other things are going on > and vacuum analyze after modifying a large portion of the database (note > that if the database is particularly large you'll probably need to change > the free space map configuration as well). I found this in my postgresql.conf #shared_buffers = 64 # 2*max_connections, min 16 #max_fsm_relations = 100 # min 10, fsm is free space map #max_fsm_pages = 10000 # min 1000, fsm is free space map #max_locks_per_transaction = 64 # min 10 #wal_buffers = 8 # min 4 Which ones are critical to the insertion performance? I looked for them in the interactive dev doc, but the descriptions were not clear enough. > > It's hard to tell what particularly you're running into, is it just a > case that you're accessing the dead tuples and that's slowing it down, What do you mean by "dead tuples"? > is it that you're changing the data in a fashion that changes how the > optimizer should be choosing to do queries, etc... > Thanks! -- Wei Weng Network Software Engineer KenCast Inc.