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 1mcbeE-0001A3-FE for pgsql-docs@arkaria.postgresql.org; Mon, 18 Oct 2021 23:02:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mcbeB-0003xg-Md for pgsql-docs@arkaria.postgresql.org; Mon, 18 Oct 2021 23:02:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcbeA-0003xW-MU for pgsql-docs@lists.postgresql.org; Mon, 18 Oct 2021 23:02:23 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcbe7-0003f7-0L for pgsql-docs@lists.postgresql.org; Mon, 18 Oct 2021 23:02:22 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 1134B3201C5C; Mon, 18 Oct 2021 19:02:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 18 Oct 2021 19:02:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=CVwbhifbmygDwo4+tlyANCzhsdsr6VRrFhFCSuew4LI=; b=eVbRCPzw 3dFFMCck6nXZpkPdD9vzuGIIeFR74gf83FZ1i8yEuUAkxFrHvhVy9qk6YVa8lISZ b4f/1tgOJ0UVCDDII7QGJ4vm86KxhDxbStqYqmxE3+PrG5d1u+f2mxFDxgoCtVcJ YHqk9EWWC+MyS0DGXhiJu271RU6+LTWUj/4Z9mlh+3bzP95c6Nd7Py8++ehZxf3C LSliNk8olgUpdIubxII9wobFlH0eHXfHBdNzXd4pR8p6WkyURWMBdUhAGnQ1AcU5 nOV2vQeTIdzdhVN6tn41ngp1x/icWHhF7Azzes5SpaJNj02hcdMj9rk5b7InVqlm ynPEKVkV0GV8tQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvuddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Oct 2021 19:02:14 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 4159D2A071A; Mon, 18 Oct 2021 20:02:11 -0300 (-03) Date: Mon, 18 Oct 2021 20:02:11 -0300 From: Alvaro Herrera To: Euler Taveira Cc: "nikolai.berkoff" , "pgsql-docs@lists.postgresql.org" Subject: Re: vacuumdb --analyze-in-stages Message-ID: <202110182302.42p3ddrfr7ck@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Oct-18, Euler Taveira wrote: > On Fri, Oct 8, 2021, at 6:33 AM, nikolai.berkoff wrote: > > Running --analyze-in-stages on a database with statistics causes the > > statistics to become significantly worse before they are improved. > > This could be made clearer in the documentation. > > I think the paragraph you modified *already* stated that usefulness of > --analyze-in-stages (newly populated from a restored dump or by pg_upgrade). I > don't think your change is an improvement for --analyze-in-stages description. > If you read the previous paragraph, it explains _how_ (3 stages of ANALYZE with > different settings) and _why_ (produce usable statistics faster). Yeah, but it doesn't say that the initial stats target (1) is the worst value you could possibly have. I wonder if it isn't better to *remove* the second phrase from this paragraph, and leave just this text: This option is useful to analyze a database that was newly populated from a restored dump or by pg_upgrade. to avoid giving the impression that it'll improve things if you run it in a database with existing statistics. Or we could proactively warn more explicitly about the problem: This option is useful to analyze a database that was newly populated from a restored dump or by pg_upgrade. Beware that running with this option in a database with existing statistics may cause query optimizer choices to become transiently worse, because of the very low statistics target that is used in the early stages. Or maybe just This option is useful to analyze a database that was newly populated from a restored dump or by pg_upgrade. Running with this option in a database with existing statistics is not recommended. Given that the first stage uses statistic target=1, running this option in a database with any stats at all is probably a bad idea. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/