From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jochen Erwied <jochen@pgsql.erwied.eu>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5722: vacuum full does not update last_vacuum statistics
Date: Sun, 27 Feb 2011 18:04:52 -0500 (EST)
Message-ID: <201102272304.p1RN4qb17352@momjian.us> (raw)
In-Reply-To: <8123.1288018987@sss.pgh.pa.us>
Tom Lane wrote:
> Jochen Erwied <jochen@pgsql.erwied.eu> writes:
> > Monday, October 25, 2010, 4:12:39 PM you wrote:
> >> "Jochen Erwied" <jochen@pgsql.erwied.eu> writes:
> >>> VACUUM FULL does not update statistics so display of pg_stat_user_tables is
> >>> wrong. A normal VACUUM updates the relevant information.
>
> >> Hmm. This is a definitional issue: what do we really mean by last_vacuum?
> >> I'm inclined to think that the current behavior is reasonable. VACUUM
> >> FULL is (still) not intended as a routine maintenance operation, and
> >> the point of that column is to track routine maintenance operations.
>
> > Well, when reading
> > http://www.postgresql.org/docs/current/static/monitoring-stats.html
> > then last_vacuum contains the last time of a user-initiated vacuum. There's
> > no distinction made what kind of vacuum was made. And IMHO even if VACUUM
> > FULL isn't meant for routine vacuuming, the state should be changed.
>
> Perhaps. The new implementation of VACUUM FULL is really more like a
> CLUSTER, or one of the rewriting variants of ALTER TABLE. Should all
> of those operations result in an update of last_vacuum? From an
> implementation standpoint it's difficult to say that only some of them
> should, because all of them result in a table that has no immediate
> need for vacuuming. The only argument I can see for having only VACUUM
> FULL update the timestamp is that it's called VACUUM and the others
> aren't. Which is an argument, but not a terribly impressive one IMO.
>
> > Of course the easiest way to fix this bug (or better flaw) is to change the
> > documentation :-)
>
> Yeah, that part of the docs will require editing no matter what we do.
> I'm just trying to get some clarity on what the most reasonable behavior
> is.
I have updated the documentation to say that vacuum statistics and
counts are for non-FULL vacuums; applied patch attached.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
Attachments:/rtmp/vacuum.diff (text/x-diff, 2.0K) downloaddiff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgmlindex 2dc1bfc..aaa613e 100644--- a/doc/src/sgml/monitoring.sgml+++ b/doc/src/sgml/monitoring.sgml@@ -325,11 +325,11 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
scans, numbers of row insertions, updates, and deletions,
number of row updates that were HOT (i.e., no separate index update),
numbers of live and dead rows,
- the last time the table was vacuumed manually,+ the last time the table was non-<option>FULL</> vacuumed manually,
the last time it was vacuumed by the autovacuum daemon,
the last time it was analyzed manually,
the last time it was analyzed by the autovacuum daemon,
- number of times it has been vacuumed manually,+ number of times it has been non-<option>FULL</> vacuumed manually,
number of times it has been vacuumed by the autovacuum daemon,
number of times it has been analyzed manually,
and the number of times it has been analyzed by the autovacuum daemon.
@@ -781,7 +781,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
<entry><literal><function>pg_stat_get_last_vacuum_time</function>(<type>oid</type>)</literal></entry>
<entry><type>timestamptz</type></entry>
<entry>
- Time of the last vacuum initiated by the user on this table+ Time of the last non-<option>FULL</option> vacuum initiated by the user on this table
</entry>
</row>
@@ -814,7 +814,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
<entry><literal><function>pg_stat_get_vacuum_count</function>(<type>oid</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry>
- The number of times this table has been vacuumed manually+ The number of times this table has been non-<option>FULL</> vacuumed manually
</entry>
</row>
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-bugs@postgresql.org
Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, jochen@pgsql.erwied.eu
Subject: Re: BUG #5722: vacuum full does not update last_vacuum statistics
In-Reply-To: <201102272304.p1RN4qb17352@momjian.us>
References: <8123.1288018987@sss.pgh.pa.us> <201102272304.p1RN4qb17352@momjian.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