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 1q2QJh-0002PY-5g for pgsql-bugs@arkaria.postgresql.org; Fri, 26 May 2023 05:48:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2QJf-00017A-3z for pgsql-bugs@arkaria.postgresql.org; Fri, 26 May 2023 05:48:43 +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 1q2QJe-00016v-Rj for pgsql-bugs@lists.postgresql.org; Fri, 26 May 2023 05:48:42 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2QJb-002DoB-5t for pgsql-bugs@lists.postgresql.org; Fri, 26 May 2023 05:48:42 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9A644320094E; Fri, 26 May 2023 01:48:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 26 May 2023 01:48:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1685080116; x=1685166516; bh=Fk OqTXahTTVxgi7k9W5VCOoloOR5cewxNMxSQRA6UDY=; b=oUoLVOtUzPyMTnFYKx JIQwmc9whO4ve1kuHzF4/a33E55Qeg7JxZKS9HnRtmgG+xiIsRRaU6DcGWRRF6Fx anZTcCwjJQEkGQLPvM0zQ9+Fcfp94rU/KFucTXjOb/IqRqnVUOGmJwKmtSaK9pOs qfyfl6Df5z1iqVhAv7MsJZqaCGuZyuKcO9odvDmvjxSAuN5UVbGWSMSknK8eHuFw 5Oy/G2uLjzhZc/nyOGQnGUFUJJJelxzYugpgNj4qUmREIFBiVEbawqiAtZNqTxZb Ak7ltaCKWPfZ6Waak62jkOmnWbDfbI3Dd8F3PxUyYnqdm1eIMM1YalduAu4Rxrre MiCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1685080116; x=1685166516; bh=FkOqTXahTTVxg i7k9W5VCOoloOR5cewxNMxSQRA6UDY=; b=XhB6/uMzDRkVHdPVUnw14msJwHo1m qsGtOVPxDnQxbc9a2pMjvk+TTn7rv9Tb0bUAVNLzb7Be0pcheCT81Qd473aWUaXV 33hpQ59d/sOUmtJwb8Xi0RhUtugW34ZImu1X3FiBk7kGUZb9CdPkqFEVMrQ4853O P1a/vOk+CDi9duj/njbLV7YWP1YEeJyDuAjsY74q2ZzvhctmqohGViLq5X1P5WWG EQsUWquoTgZ6gVk2T6BHsgZJdC+E635+T+ZF0XMKs+lYjdCP4S2DWAepe7lqgcuq iHLmQXFdjzysgy+r0Yi4cvq07AslPQNRbAJm6rG+rI/3QqqRuaihPqgHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejkedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 May 2023 01:48:34 -0400 (EDT) Date: Fri, 26 May 2023 14:48:30 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: henri.chapelle@dbandmore.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17942: vacuumdb doesn't populate extended statistics on partitioned tables Message-ID: References: <17942-50aa28accc2e412c@postgresql.org> <20230525.130759.1771148055252912581.horikyota.ntt@gmail.com> <20230526.091536.1662896499070434031.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2cym+aGVxiPMYbJ/" Content-Disposition: inline In-Reply-To: <20230526.091536.1662896499070434031.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2cym+aGVxiPMYbJ/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 26, 2023 at 09:15:36AM +0900, Kyotaro Horiguchi wrote: > It seems to be exactly the same as ANALYZE, though. I'm a bit unclear > about our perspective on this SQL command's behavior. Sorry for being a bit unclear here. When dealing with partitioned tables, a database-wide ANALYZE processes the partitions individually as well as a full partition/inheritance tree. My point is slightly different though: your suggestion of adding RELKIND_PARTITIONED_TABLE to the filter added in vacuumdb would work for -Z, but it would cause the vacuum code path of vacuumdb to process more than once all the partitions in a single run. For instance, take this schema:=20 CREATE TABLE parent_list (id int) PARTITION BY LIST (id); = = =20 CREATE TABLE child_list PARTITION OF parent_list FOR VALUES IN (1, 2); = = =20 `vacuumdb` would now list both parent_list and child_list, making child_list being vacuumed twice, which is not necessary. In order to get a behavior in parity with the SQL commands ANALYZE, VACUUM and VACUUM ANALYZE, we need to be more careful about the addition of RELKIND_PARTITIONED_TABLE to the filtering clause. -- Michael --2cym+aGVxiPMYbJ/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmRwSC4ACgkQnvQgOdby QH22RA/8DkCOwoogvhux1rkse72GLvUtTvX7/Su56oAOuyUNWykAffM9OKIF20lM RgMCL2E8Lf3rFPjif/xmW0yxN321pmchlalu5GY2d1ugLNrmStO8W0l8bU2IrGey sWILMF5uBX7fyKZL6K3jrDpgN1WdaUStsNRbjNa8uMrstHQc8MEfIBy9FcrgUiEb omaYhh3pUIqt+tsXBAWLfBfHssO/y16bFtF35HF7vjTZl9mwAY5AUVM+oOMWK6p6 2WyE44g3bScfdI+pPlIukm9b1esdaESHcRuQlG22LSAHb3XwLPZenY9FOt7ynZPR t+8c6OCpwNl3mZuhZa4YLXVv3UZqu83jH1JRUXPu8bEGB20GxYPQnh6MHae+AE08 NeOGwEC3fL3yf+cneQI1gOYGTZ5spHeMGuzSmri2nH/+F11yOPj1XGuQvDMdzRtS ezfUn1sJwF79PNwFt7+6X0rtMRYoNVKqvvAbabR1oOYNAMZUT6nAEyis0IjCLDfL msQ8VtHrZTBy4/302FsVPqY2OENqqL/zuy3f6uM0QCDNhu6JKkz6r2NlWlfFI+gR g1XgcUM7U/oC9WrJmrUO5nIHn5g/CQJR08IoBcCNkTUj91vXwyF/ZtP2iyoiaDeB dAPOYuKN9AaLwA2r5loTR0DXzh4NEq7jOeht34U6k9v6jEvuMao= =NEyG -----END PGP SIGNATURE----- --2cym+aGVxiPMYbJ/--