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 1lTsl3-0008KY-Ht for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Apr 2021 20:57:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lTsl2-0001MT-69 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Apr 2021 20:57:08 +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 1lTsl1-0001MM-Cl for pgsql-hackers@lists.postgresql.org; Tue, 06 Apr 2021 20:57:07 +0000 Received: from [66.111.4.229] (helo=new3-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTskz-0002WW-6S for pgsql-hackers@lists.postgresql.org; Tue, 06 Apr 2021 20:57:06 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 3FD7A580845; Tue, 6 Apr 2021 16:56:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 06 Apr 2021 16:56:54 -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=DZrCpefPyyaN9jhCZU0gXkPNT2q3xF5fPY31lCMqgTI=; b=I/z9Qkye J2iOIA/8x1Gy+YSGiWZOiqXyWPeRWf8tSOooMZJSiY89ttGloP4IuX22mVlkv2W7 RJOC4Hdd7TUUMN1z7oeIxXQiSbAkcWtVsqHUTRL6D8JrvyT7jHyp1WF9IGJl8irq NUXsl0/udiqLdLJXI4MwP3anrGNU06oCCP6+YgLTUXU4HEXBPZBqbIsqWRHaCffl z2JZi1XiukAw2qTe7uNylc5DVWblbahhyv3C8VIkDuEw8vdrBKrwUDUTftF21bUu zWCjzKVS/gCbKc13yRl3+4pHauS+twKmgCJiDmCowxRrEdzjnd0ERUA4QikhDsqO q5lbj/bgllwSGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejhedguddtfecutefuodetggdotefrod 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 0E8EB1080054; Tue, 6 Apr 2021 16:56:52 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8205A2A0A89; Tue, 6 Apr 2021 16:56:49 -0400 (-04) Date: Tue, 6 Apr 2021 16:56:49 -0400 From: Alvaro Herrera To: Tomas Vondra Cc: yuzuko , David Steele , Kyotaro Horiguchi , Justin Pryzby , Daniel Gustafsson , Amit Langote , Masahiko Sawada , Laurenz Albe , PostgreSQL Hackers , Greg Stark Subject: Re: Autovacuum on partitioned table (autoanalyze) Message-ID: <20210406205649.GA20523@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <73dc10a0-cc6a-5d12-7f0f-e7410fa76d9c@enterprisedb.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.229 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Apr-04, Tomas Vondra wrote: > 1) I still don't understand why inheritance and declarative partitioning > are treated differently. Seems unnecessary nad surprising, but maybe > there's a good reason? I think there is a good reason to treat them the same: pgstat does not have a provision to keep stats both of the table with children, and the table without children. It can only have one of those. For partitioning that doesn't matter: since the table-without-children doesn't have anything on its own (no scans, no tuples, no nothing) then we can just use the entry to store the table-with-children data. But for the inheritance case, the parent can have its own tuples and counts its own scans and so on; so if we change things, we'll overwrite the stats. Maybe in the long-term we should allow pgstat to differentiate those cases, but that seems not in scope for this patch. I'm working on the code to fix the other issues. -- Álvaro Herrera 39°49'30"S 73°17'W