pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Guillaume Cottenceau <gc@mnc.ch>
Cc: pgsql-performance@postgresql.org
Subject: Re: estimating the need for VACUUM FULL and REINDEX
Date: Fri, 11 May 2007 13:25:04 -0400
Message-ID: <20070511172504.GH17314@alvh.no-ip.org> (raw)
In-Reply-To: <87lkfve5r3.fsf@meuh.mnc.lan>
References: <87odkvmsav.fsf@meuh.mnc.lan>
	<87lkfve5r3.fsf@meuh.mnc.lan>

Guillaume Cottenceau wrote:
> Guillaume Cottenceau <gc 'at' mnc.ch> writes:
> 
> > With that in mind, I've tried to estimate how much benefit would
> > be brought by running VACUUM FULL, with the output of VACUUM
> > VERBOSE. However, it seems that for example the "removable rows"
> > reported by each VACUUM VERBOSE run is actually reused by VACUUM,
> > so is not what I'm looking for.
> 
> I've tried to better understand how autovacuum works (we use 7.4)
> to see if a similar mechanism could be used in 7.4 (e.g. run
> VACUUM ANALYZE often enough to not end up with a need to VACUUM
> FULL).
> 
> The autovacuum daemon uses statistics collected thanks to
> stats_row_level. However, inside pg_stat_user_tables, the values
> n_tup_upd and n_tup_del seem to be reported from pg startup and
> never reset, whereas the information from previous VACUUM would
> be needed here, if I understand correctly. Is there anything that
> can be done from that point on with existing pg information, or
> I'd need e.g. to remember the values of my last VACUUM myself?

In 7.4 there was the pg_autovacuum daemon in contrib, wasn't there?  No
need to write one yourself.

AFAIR what it did was precisely to remember the numbers from the last
vacuum, which was cumbersome and not very effective (because they were
lost on restart for example).  Also, the new autovac has some features
that the old one didn't have.  Ability to set per-table configuration
for example.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



view thread (7+ messages)  latest in thread

Message-ID: <20070511172504.GH17314@alvh.no-ip.org>
Permalink:  ../20070511172504.GH17314@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070511172504.GH17314@alvh.no-ip.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: alvherre@commandprompt.com, gc@mnc.ch
  Subject: Re: estimating the need for VACUUM FULL and REINDEX
  In-Reply-To: <20070511172504.GH17314@alvh.no-ip.org>
  References: <87odkvmsav.fsf@meuh.mnc.lan> <87lkfve5r3.fsf@meuh.mnc.lan> <20070511172504.GH17314@alvh.no-ip.org>

* 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