Re: pg_stat_get_last_vacuum_time(): why non-FULL? - Mailing list pgsql-general

From Kevin Grittner
Subject Re: pg_stat_get_last_vacuum_time(): why non-FULL?
Date
Msg-id 1365458947.69128.YahooMailNeo@web162901.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: pg_stat_get_last_vacuum_time(): why non-FULL?  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: pg_stat_get_last_vacuum_time(): why non-FULL?
Re: pg_stat_get_last_vacuum_time(): why non-FULL?
List pgsql-general
Jeff Janes <jeff.janes@gmail.com> wrote:
> Amit Kapila <amit.kapila@huawei.com> wrote:

>> One of the important difference is that during the time VACUUM
>> FULL is operating on a relation, no other operations will be
>> allowed on that relation. Most of admin care about this point,
>> because they don't want to stop operations for background
>> garbage collect.

> While that is true, it is not a reason not to update
> pg_stat_get_last_vacuum_time.  I'm having a hard time coming up
> with a reason not to update pg_stat_get_last_vacuum_time with a
> full vacuum.
>
> On version 8.4 and below, you could justify it by saying that
> VACUUM FULL bloated the indexes and then left them that way, and
> so we shouldn't update the time field.  But that is no longer the
> case.  And even then, doing a ordinary vacuum afterwards isn't
> going to fix the index bloat, so even that argument is a bit
> sketchy.

I'm not sure that what we're doing now is correct, but updating
things as if a normal vacuum had been done would *not* be the thing
to do.  For starters, VACUUM FULL blows away the free space map and
visibility map for a table.  Among other things, that means that
index-only scans will cease to work until the table has a normal
vacuum.  A normal vacuum (or autovacuum) will restore those, so a
VACUUM FULL should probably set things up to show that the table is
in need of a vacuum soon.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-general by date:

Previous
From: Ramsey Gurley
Date:
Subject: Inconsistent query performance
Next
From: Bruce Momjian
Date:
Subject: Re: How to find more description of Bug than what is given in release notes