pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bill Montgomery <billm@lulu.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Avoiding vacuum full on an UPDATE-heavy table
Date: Fri, 21 May 2004 18:09:24 -0400
Message-ID: <16535.1085177364@sss.pgh.pa.us> (raw)
In-Reply-To: <40AE274F.7020800@lulu.com>
References: <40AE274F.7020800@lulu.com>

Bill Montgomery <billm@lulu.com> writes:
> I have a particularly troublesome table in my 7.3.4 database. It 
> typically has less than 50k rows, and a usage pattern of about 1k 
> INSERTs, 50-100k UPDATEs, and no DELETEs per day. It is vacuumed and 
> analyzed three times per week.

You probably want to vacuum (non-FULL) once a day, if not more often.
Also take a look at your FSM settings --- it seems like a good bet that
they're not large enough to remember all the free space in your
database.

With adequate FSM the table should stabilize at a physical size
corresponding to number-of-live-rows + number-of-updates-between-VACUUMs, 
which would be three times the minimum possible size if you vacuum once
a day (50K + 100K) or five times if you stick to every-other-day
(50K + 200K).  Your VACUUM FULL output shows that the table had bloated
to hundreds of times the minimum size:

> INFO:  Rel xxxx: Pages: 188903 --> 393; Tuple(s) moved: 17985.

and AFAIK the only way that will happen is if you fail to vacuum at all
or don't have enough FSM.

The indexes are looking darn large as well.  In 7.3 about the only thing
you can do about this is REINDEX the table every so often.  7.4 should
behave better though.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <16535.1085177364@sss.pgh.pa.us>
Permalink:  ../16535.1085177364@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16535.1085177364@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, billm@lulu.com
  Subject: Re: Avoiding vacuum full on an UPDATE-heavy table
  In-Reply-To: <16535.1085177364@sss.pgh.pa.us>

* 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