Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jason Ralph <jralph(at)affinitysolutions(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table
Date: 2019-11-02 14:22:27
Message-ID: 19520.1572704547@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jason Ralph <jralph(at)affinitysolutions(dot)com> writes:
> I am trying to find out if the naming convention from autovacuum does what its command line equivalent does, or at least what I think it does.

> QUERY: autovacuum: VACUUM ANALYZE table versus autovacuum: VACUUM ANALYZE table.

> I have been getting my autovacuum tuned and I have the settings where I see 2 types of queries running now and doing their jobs. I know vacuum alone will mark dead tuples ready for use again, and analyze alone will update statistics for the query planner.

> 1. QUERY: autovacuum: VACUUM ANALYZE table
> 2. QUERY: autovacuum: VACUUM table

> My question is do we need both?

Some autovacuum runs will do only VACUUM on a given table, some will do
only ANALYZE, and some will do both. The decisions about which of
these operations are needed are related but not identical (one's based
on n_dead_tup and the other on n_mod_since_analyze, plus you can set
different threshold parameters to compare those to). The pg_stat_activity
report of what's happening does match the command-line syntax.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message M Tarkeshwar Rao 2019-11-02 16:16:15 RE: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)
Previous Message Adrian Klaver 2019-11-02 14:12:00 Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table