Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRahi-0007i3-HZ for pgsql-admin@arkaria.postgresql.org; Wed, 31 Mar 2021 13:16:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRahh-0003XG-HF for pgsql-admin@arkaria.postgresql.org; Wed, 31 Mar 2021 13:16:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRahh-0003X9-9i for pgsql-admin@lists.postgresql.org; Wed, 31 Mar 2021 13:16:13 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRahe-0007Iu-5u for pgsql-admin@lists.postgresql.org; Wed, 31 Mar 2021 13:16:12 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lRahd-0004sT-BQ; Wed, 31 Mar 2021 09:16:09 -0400 Date: Wed, 31 Mar 2021 09:16:09 -0400 From: Bruce Momjian To: Vineet Naik Cc: pgsql-admin@lists.postgresql.org Subject: Re: Finding out if 'vacuum --analyze-in-stages' has generated enough stats Message-ID: <20210331131609.GB11609@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 31, 2021 at 12:38:14PM +0530, Vineet Naik wrote: > > This option will try to create some statistics as fast as possible, to make the database usable, and then produce full statistics in the subsequent stages. > > So my question is, after which stage is it ok to send traffic to the > server without much performance impact? Also, is it possible to query > the stats view in pg and determine if enough stats have been > generated? That is a very hard question to answer. Some queries have only a few possible plans, so few or no statistics are fine. Other queries require detailed statistics to generate efficient plans. I think you need to set up a dummy server with no stats and try your workload on that, then run the stages manually and test after each stage to see how the performance is. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.