Skip site navigation (1) Skip section navigation (2)

Re: Autvacuum and Analyze stats?

From: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
To: Machiel Richards <machielr(at)rdc(dot)co(dot)za>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Autvacuum and Analyze stats?
Date: 2010-04-13 12:41:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Tue, 2010-04-13 at 12:03 +0200, Machiel Richards wrote:

>  Is there a way to confirm when last the autovacuum ran 

Check pg_stat_user_tables (or pg_stat_{all,sys,user}_tables. They
include autovacuum info.

> (and if so was there any errors).

If you are running 8.3+, you may enable autovacum logging by setting
log_autovacuum_min_duration to 0, and check for any issues.

> The auto vacuum is configured to run every 60 seconds, however the
> check_postgres package states that the last vacuum was 12 days ago and
> I need to see if I can confirm this manually.

autovacuum updates last_autovacuum (and last_autoanalyze) columns. The
columns you mention are last_vacuum (and last_analyze), and they are
updated when manual vacuum is run. So you are using last_vacuum
parameter. You may also want to use last_autovacuum parameter of

> I am also trying to find out if there is a way of seeing
> when last a table / database had been analyzed if ever.

See above (pg_stat_user_tables)

PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository:
Community:,  Twitter:

In response to

pgsql-novice by date

Next:From: Jasen BettsDate: 2010-04-13 12:58:42
Subject: Re: Partitioning for query performance
Previous:From: Ognjen BlagojevicDate: 2010-04-13 10:26:46
Subject: Re: Getting started

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group