Re: pg_stat_get_last_vacuum_time(): why non-FULL?

From: CR Lender <crlender(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_stat_get_last_vacuum_time(): why non-FULL?
Date: 2013-03-27 14:43:34
Message-ID: 51530596.7010604@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2013-03-26 19:28, Kevin Grittner wrote:
>> Why are full vacuums excluded from this statistic? It looks like there's
>> no way to get the date of the last manual vacuum, if only full vacuums
>> are performed.
>
> Because FULL is a bit of a misnomer -- there are important things a
> non-FULL vacuum does which a FULL vacuum does not. In general, a
> VACUUM FULL should be followed by a non-FULL vacuum to keep the
> database in good shape.

Thank you, that's very helpful. I wasn't aware of that.

> Also, a VACUUM FULL is an extreme form of
> maintenance which should rarely be needed; if you find that you
> need to run VACUUM FULL, something is probably being done wrong
> which should be fixed so that you don't need to continue to do such
> extreme maintenance.

In this case I was only trying to make sense of an existing database
(8.3). The statistics in pg_stats were way off for some tables, so I
wanted to see if (auto)vacuum and (auto)analyze were being run.
pg_stat_all_tables() showed last_autoanalyze at >400 days for some of
the larger tables. There used to be a weekly cron job with VACUUM FULL
ANALYZE, and I was trying to find out if that cron job was still active.

Thanks,
crl

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Lawrence Barwick 2013-03-27 15:07:19 Re: Understanding behavior of SELECT with multiple unnested columns
Previous Message Greg Sabino Mullane 2013-03-27 14:40:13 Re: pltcl and modules question