pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeremy Haile <jhaile@fastmail.fm>
To: pgsql-performance@postgresql.org
Subject: High inserts, bulk deletes - autovacuum vs scheduled vacuum
Date: Tue, 09 Jan 2007 12:26:41 -0500
Message-ID: <1168363601.5177.1168380907@webmail.messagingengine.com> (raw)

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



view thread (10+ messages)  latest in thread

Message-ID: <1168363601.5177.1168380907@webmail.messagingengine.com>
Permalink:  ../1168363601.5177.1168380907@webmail.messagingengine.com/
Also on:    postgresql.org/message-id/1168363601.5177.1168380907@webmail.messagingengine.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jhaile@fastmail.fm
  Subject: Re: High inserts, bulk deletes - autovacuum vs scheduled vacuum
  In-Reply-To: <1168363601.5177.1168380907@webmail.messagingengine.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox