pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Jason Ralph <jralph@affinitysolutions.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table
Date: Sat, 2 Nov 2019 07:12:00 -0700
Message-ID: <d0507541-c81e-8961-8140-3bd121f79e1b@aklaver.com> (raw)
In-Reply-To: <BL0PR04MB64991E90411166331F051CFCD07D0@BL0PR04MB6499.namprd04.prod.outlook.com>
References: <BL0PR04MB64991E90411166331F051CFCD07D0@BL0PR04MB6499.namprd04.prod.outlook.com>

On 11/1/19 7:49 PM, Jason Ralph wrote:
> Hello list,
> 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.

The above are the same, I'm guessing you are referring to 1) and 2) below.

> 
> 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?  Why wouldn't QUERY: autovacuum: VACUUM ANALYZE table perform both, I always thought when issuing VACUUM ANALYZE table it would do both. Why wouldn't we just want vacuum analyze to run?
> Or is QUERY: autovacuum: VACUUM ANALYZE table different from the command line and it only analyzes and QUERY: autovacuum: VACUUM table only vacuums which would make sense.

See here:
https://www.postgresql.org/docs/11/routine-vacuuming.html#AUTOVACUUM

"Each worker process will check each table within its database and 
execute VACUUM and/or ANALYZE as needed"

In same section read sections on vacuum and analyze thresholds, which 
determine the 'and/or' above.

The commands are the same. Autovacuum is just a background process that 
calls the regular VACUUM/ANALYZE commands as needed.

> 
> 
> Thanks as always and hope this is clear.
> 
> 
> Jason Ralph
> 
> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (3+ messages)  latest in thread

Message-ID: <d0507541-c81e-8961-8140-3bd121f79e1b@aklaver.com>
Permalink:  ../d0507541-c81e-8961-8140-3bd121f79e1b@aklaver.com/
Also on:    postgresql.org/message-id/d0507541-c81e-8961-8140-3bd121f79e1b@aklaver.com

 · 

reply

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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, jralph@affinitysolutions.com
  Subject: Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table
  In-Reply-To: <d0507541-c81e-8961-8140-3bd121f79e1b@aklaver.com>
  References: <BL0PR04MB64991E90411166331F051CFCD07D0@BL0PR04MB6499.namprd04.prod.outlook.com> <d0507541-c81e-8961-8140-3bd121f79e1b@aklaver.com>

* 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