Re: BUG #15245: pg_stat_all_tables does not include partition master tables

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Mahadevan Ramachandran <mahadevan(at)rapidloop(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15245: pg_stat_all_tables does not include partition master tables
Date: 2018-06-18 12:49:43
Message-ID: 20180618124943.GB1721@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jun 18, 2018 at 07:21:17PM +0900, Amit Langote wrote:
> I'm not sure of the vacuum (maybe NULL's the answer in that case), but if
> we ever teach autovacuum the ability to *analyze* partitioned tables, then
> we could simply record the time when that happens, instead of worrying
> 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.

Even for the last_* columns, it is not really possible to have one
single definition for the partition parents. Here are a set of stats
which could be useful depending on the context:
- average of the last runs.
- deviation of the last runs.
- Latest one which ran.
- Oldest one which ran.

The same applies for the tuples inserted and/or deleted, scans,
etc. Users may want to know the deviation to check for the balance
across partitions, or the sum of them, or even the average. For those
reasons having entries in pg_stat_all_tables or such for parent
partitions has little meaning, and having something which allows to grab
a complete partition tree has way more value because it becomes easier
to gather stats about the whole tree.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mahadevan Ramachandran 2018-06-18 13:58:15 Re: BUG #15245: pg_stat_all_tables does not include partition master tables
Previous Message Amit Langote 2018-06-18 10:21:17 Re: BUG #15245: pg_stat_all_tables does not include partition master tables