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 1lUcE1-0005ne-0h for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 21:30:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lUcDy-0005vs-0p for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 21:30:02 +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 1lUcDx-0005sO-5i for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 21:30:01 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUcDu-0001OX-AO for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 21:30:00 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1F3E15C00D4; Thu, 8 Apr 2021 17:29:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 08 Apr 2021 17:29:55 -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= fm2; bh=9EnBkac7dGXZPYUNUnia3mz2dxVsujeE0lr+tgJDqAA=; b=XqcUswX1 CY3DyBm43mCxOLenMQst14vy35fgqbm27M/T4AUCrMa7CBEqcMpg/TsvrqnHQOr3 FfA+6lV9+9s55+Q1pJGBZGM8SePj2feUWqAQhk6SN0Tfr5RkAlODsn0zKXM39OxN 5l3l/V5GAGfvYRoKKGBLp9d13R49xpxXUWWDCrMf38wLayoviVIhPmMLEyQiIFAA p0eRfBevDmmShLR2PGaEiV5UKz3y18u2TW6FEP7zIduOH3PbgDn6MGSHOQCSuv1v qxrlxWqxaABdEOvUtgXnnelPXAiEa7WYOTOCxzlddBOHFS9hqv1x8dVWliKgoV6t GBogCdoe4tjAlQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejledgudeifecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueef ieeivefgteehueefteehvdenucfkphepudeltddrleehrdduledrleehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 2C39F240067; Thu, 8 Apr 2021 17:29:54 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 91A342A0874; Thu, 8 Apr 2021 17:29:51 -0400 (-04) Date: Thu, 8 Apr 2021 17:29:51 -0400 From: Alvaro Herrera To: Zhihong Yu Cc: Tom Lane , PostgreSQL Developers Subject: Re: pgsql: autovacuum: handle analyze for partitioned tables Message-ID: <20210408212951.GA15182@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 2021-Apr-08, Zhihong Yu wrote: > Hi, > Within truncate_update_partedrel_stats(), dirty is declared within the loop. > + if (rd_rel->reltuples != 0) > + { > ... > + if (dirty) > > The two if blocks can be merged. The variable dirty can be dropped. Hi, thanks for reviewing. Yes, evidently I copied vac_update_relstats too closely -- that boolean is not necessary. -- Álvaro Herrera Valdivia, Chile