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 1mccaf-0004Hg-O2 for pgsql-docs@arkaria.postgresql.org; Tue, 19 Oct 2021 00:02:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mccad-0005Jv-H7 for pgsql-docs@arkaria.postgresql.org; Tue, 19 Oct 2021 00:02:47 +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 1mccac-0005Jl-4R for pgsql-docs@lists.postgresql.org; Tue, 19 Oct 2021 00:02:47 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mccaZ-0001ac-IQ for pgsql-docs@lists.postgresql.org; Tue, 19 Oct 2021 00:02:45 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 3E3093201C16; Mon, 18 Oct 2021 20:02:42 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute1.internal (MEProxy); Mon, 18 Oct 2021 20:02:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=nyixNJQiIePpSIL8vflXRSXilejYcUd OBXXoo8H+IYU=; b=SetHqgmN23AK+VlA1u8q8gC46s896a8JK/8y5Pu9Duu2AOF LhwJpebAInbtIJmqyLBAqHKwFP9daxsdkRj8zvEnBokjoBqXT0phyBtg7yQxH774 b2e0wSrwjX0zjMyTgmWGJot0k1uLsZViu9thOzTH+eHeeh1jzJ/e4VsSbGPF4Oai 4Lp3Ljh+ahBvX6wMTX9DgAEVTX8avLkVA5vyGnTG2HdideWXd/0lZZUOXqzKPgxE +d6/d+rBG7Fk/Tk0HOrDnb1cpi0ioIcBnCvGxlIZXsUzgxUelJ8SmsiNusGNRj7Q JNFaDMwZejpD3x0brYeXWzu7+4oSJ+hv1PwCUcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=nyixNJ QiIePpSIL8vflXRSXilejYcUdOBXXoo8H+IYU=; b=Ad61zDhMziam4+NOMhqxlJ VvQDdtb4AbFYziMRATOocVbOYf1qN413+sooqct4wr7OK/O1Ce3rL7qB+RErRbrs OVItWU74Yt8iFEysImDAcY+N8X1OlY+SwYXHQYVNY0O7paC6jQAInFxsB6qAwOuX cK983TG0/mRGhivl4IUqsX0m4paA6/HUwt0b//5Ipxp+UYExnPy8jvvt5gpv72aT s5rtGIuXA39rrdeCah8u8RS7UQ/cBnKJ/95ko/3mXh2HBQCx2LAWmZ3mCJu+j8Qi xywDC7xCYiXU0F0f3U4uhOemm/YWZ615tjzcPwiLC47y2YoF0TpM4v8oS6rPqjsg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvuddgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreertdenucfhrhhomhepfdfguhhl vghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtf frrghtthgvrhhnpeejtefhuedvgffftdetvedufedtjeeuffekleevkefhveekgeelfefh jeehtdejgeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghu lhgvrhhtohdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4895851C0060; Mon, 18 Oct 2021 20:02:41 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1345-g8441cd7852-fm-20211006.001-g8441cd78 Mime-Version: 1.0 Message-Id: <3907a55d-a40f-4566-9906-150fca10f0df@www.fastmail.com> In-Reply-To: <202110182353.6lbwp4redjd2@alvherre.pgsql> References: <202110182353.6lbwp4redjd2@alvherre.pgsql> Date: Mon, 18 Oct 2021 21:02:08 -0300 From: "Euler Taveira" To: "Alvaro Herrera" , "David G. Johnston" Cc: "nikolai.berkoff" , "pgsql-docs@lists.postgresql.org" Subject: Re: vacuumdb --analyze-in-stages Content-Type: multipart/alternative; boundary=45e72cd7e5b84ebb80da929b3e304c43 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --45e72cd7e5b84ebb80da929b3e304c43 Content-Type: text/plain On Mon, Oct 18, 2021, at 8:53 PM, Alvaro Herrera wrote: > On 2021-Oct-18, David G. Johnston wrote: > > > On Mon, Oct 18, 2021 at 4:02 PM Alvaro Herrera > > wrote: > > > > 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. > > > > Add the word "only"? > > > > This option is only useful to analyze a database... > > Maybe this is sufficient, since it would drive people away from trying > to do anything else than help upgrades with it. +1. I like your 2nd suggestion. "This option is only 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." > > > "Run several (currently three) stages of analyze with different > > configuration settings, to produce usable statistics faster. The first of > > these stages will remove any existing statistics even if they use a larger > > statistic target configuration." > > .. yeah, this is another option. We might include it too but I would suggest "replace" instead of "remove" because it seems there won't be statistics after the first stage. -- Euler Taveira EDB https://www.enterprisedb.com/ --45e72cd7e5b84ebb80da929b3e304c43 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Mon, Oct 18,= 2021, at 8:53 PM, Alvaro Herrera wrote:
On 2021-Oct-18, David G. Johnston wrote:

> On Mon, Oct 18, 2021 at 4:02 PM Alvaro = Herrera <alvherre@alvh.no-= ip.org>
> wrote:

&g= t; > Given that the first stage uses statistic target=3D1, running th= is option
> > in a database with any stats at all is= probably a bad idea.
>
> Add the word= "only"?
> 
> This option is only= useful to analyze a database...

Maybe this= is sufficient, since it would drive people away from trying
to do anything else than help upgrades with it.
+1. I like your 2nd suggestion.

"This= option is only useful to analyze a database that was newly populated fr= om
a restored dump or by <command>pg_upgrade</com= mand>.  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 statistic= s target
that is used in the early stages."

=

> "Run several (currently three) stages of analyze with different
> configuration settings, to produce usable statistics fa= ster.  The first of
> these stages will remove any= existing statistics even if they use a larger
> statis= tic target configuration."

.. yeah, this is= another option.
We might include it too but = I would suggest "replace" instead of "remove"
because it s= eems there won't be statistics after the first stage.

=

-= -
Euler Taveira

--45e72cd7e5b84ebb80da929b3e304c43--