Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iQuIZ-0006D4-ED for pgsql-general@arkaria.postgresql.org; Sat, 02 Nov 2019 14:22:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iQuIX-0002mZ-RG for pgsql-general@arkaria.postgresql.org; Sat, 02 Nov 2019 14:22:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iQuIX-0002mS-ID for pgsql-general@lists.postgresql.org; Sat, 02 Nov 2019 14:22:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iQuIV-00055o-4H for pgsql-general@lists.postgresql.org; Sat, 02 Nov 2019 14:22:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xA2EMR9E019521; Sat, 2 Nov 2019 10:22:27 -0400 From: Tom Lane To: Jason Ralph cc: "pgsql-general@lists.postgresql.org" Subject: Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table In-reply-to: References: Comments: In-reply-to Jason Ralph message dated "Sat, 02 Nov 2019 02:49:01 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19519.1572704547.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 02 Nov 2019 10:22:27 -0400 Message-ID: <19520.1572704547@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jason Ralph writes: > I am trying to find out if the naming convention from autovacuum does wh= at its command line equivalent does, or at least what I think it does. > QUERY: autovacuum: VACUUM ANALYZE table versus autovacuum: VACUUM ANALYZ= E 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 alo= ne will mark dead tuples ready for use again, and analyze alone will updat= e 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