Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B12299FA2D3 for ; Tue, 9 Jan 2007 13:30:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 82820-01 for ; Tue, 9 Jan 2007 13:30:21 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by postgresql.org (Postfix) with ESMTP id AEC929FB231 for ; Tue, 9 Jan 2007 13:30:19 -0400 (AST) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id 4DCA46F9C2 for ; Tue, 9 Jan 2007 12:26:41 -0500 (EST) Received: from web2.messagingengine.com ([10.202.2.211]) by out1.internal (MEProxy); Tue, 09 Jan 2007 12:26:41 -0500 Received: by web2.messagingengine.com (Postfix, from userid 99) id 282B231115; Tue, 9 Jan 2007 12:26:41 -0500 (EST) Message-Id: <1168363601.5177.1168380907@webmail.messagingengine.com> X-Sasl-Enc: eAdAjofyMB8Ol4MGZMWxaUz7iPSTTxwDMRfhsK0V118U 1168363601 From: "Jeremy Haile" To: pgsql-performance@postgresql.org Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface Subject: High inserts, bulk deletes - autovacuum vs scheduled vacuum Date: Tue, 09 Jan 2007 12:26:41 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/118 X-Sequence-Number: 22719 I am developing an application that has very predictable database operations: -inserts several thousand rows into 3 tables every 5 minutes. (table contain around 10 million rows each) -truncates and rebuilds aggregate tables of this data every 5 minutes. (several thousand rows each) -regular reads of aggregate table and sometimes large tables by user interaction -every night, hundreds of thousands of rows are deleted from these 3 tables (old data) -20-30 other tables get inserted/updated slowly throughout the day In order to optimize performance of the inserts, I disabled autovacuum/row-level stats and instead run "vacuum analyze" on the whole DB every hour. However this operation takes around 20 minutes of each hour. This means that the database is involved in vacuum/analyzing tables 33% of the time. I'd like any performance advice, but my main concern is the amount of time vacuum/analyze runs and its possible impact on the overall DB performance. Thanks! I am running 8.2 (will be 8.2.1 soon). The box is Windows with 2GB RAM connected to a SAN over fiber. The data and pg_xlog are on separate partitions. Modified configuration: effective_cache_size = 1000MB random_page_cost = 3 default_statistics_target = 50 maintenance_work_mem = 256MB shared_buffers = 400MB temp_buffers = 10MB work_mem = 10MB max_fsm_pages = 1500000 checkpoint_segments = 30 stats_row_level = off stats_start_collector = off