Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV5Nv-0004Qg-4k for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 01:24:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fV5Nt-0004CI-EX for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 01:24:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV5Nt-0004C9-8D for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 01:24:37 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fV5Nm-00033h-AQ for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 01:24:36 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w5J1OOaI008552; Tue, 19 Jun 2018 10:24:24 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 4933F63875D; Tue, 19 Jun 2018 10:24:24 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 3DB12638755; Tue, 19 Jun 2018 10:24:24 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 36D2C400B0B; Tue, 19 Jun 2018 10:24:24 +0900 (JST) Subject: Re: BUG #15245: pg_stat_all_tables does not include partition master tables References: <152922564661.24801.3078728743990100425@wrigleys.postgresql.org> <20180617120653.GD1411@paquier.xyz> <20180618020642.GC3721@paquier.xyz> <16ac0ae3-f0ba-536f-92e2-4a954dce8bbf@lab.ntt.co.jp> From: Amit Langote Message-ID: Date: Tue, 19 Jun 2018 10:24:14 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Mahadevan Ramachandran Cc: David Rowley , Michael Paquier , "David G. Johnston" , "pgsql-bugs@lists.postgresql.org" X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello. On 2018/06/18 22:58, Mahadevan Ramachandran wrote: > On Mon, Jun 18, 2018 at 3:51 PM, Amit Langote > wrote: >> about how to aggregate across partitions. We could leave that NULL for >> now, that is, if we decide to list partitioned tables in the >> pg_stat_all_tables output at all re OP's complaint. > > "Complaint" is too strong a word :-) Ah, maybe "opinion" would've been more appropriate. ;-) > I guess the real issue is that both options are a bit inconsistent. Not listing > a partitoned table in an "all tables" view does not seem any worse or better > than having it there with all columns as NULL. Should've thought about it > before I raised the bug :-) Yeah. > Might I suggest a new system view that lists all (parent, child) associations, > which can then be joined with pg_stat_all_tables so users can roll up > child table stats into each parent using whatever aggregation functions > they'd like? I guess that's more or less what Michael mentioned upthread. That we need a user-level function(s) that exposes the partition tree structure and perhaps an accompanying view that makes inspecting the stats, relation sizes, etc. of the tables in a given partition tree easier. Thanks, Amit