Re: ToDo: show size of partitioned table

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, mathias(at)brossard(dot)org, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ToDo: show size of partitioned table
Date: 2019-04-03 13:49:43
Message-ID: CAFj8pRDZaSZT15sq-aUNy5yivbt-c0ft6oLfBJmdRFRUk1NXCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 3. 4. 2019 v 14:01 odesílatel Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
napsal:

> On 2019-Apr-03, Kyotaro HORIGUCHI wrote:
>
> > Hello.
> >
> > At Wed, 3 Apr 2019 12:55:06 +0900, Amit Langote <
> Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote in <
> ee892049-0fe4-afe6-cbbf-31cf44fa8522(at)lab(dot)ntt(dot)co(dot)jp>
> > > On 2019/04/03 12:02, Kyotaro HORIGUCHI wrote:
> > > > \dPn doesn't show children because the are of 'r' relkind. And
> > > > \dPn * doesn't show type for children.
> > ...
> > > I think it's intentional that leaf partitions are not shown, because
> the
> > > patch is meant to allow showing only the "partitioned" members of
> > > partition trees. Regular \d[t|i][+] shows normal tables ('r', 'i',
> etc.)
> > > including their size, but it's useless for partitioned tables ('P',
> 'I',
> > > etc.) as far as showing the size is concerned, so the patch. Even
> \dPn is
> > > meant to only show partitions that are themselves partitioned; note the
> > > "P" in the command.
> >
> > + If the modifier <literal>n</literal> (<quote>nested</quote>) is
> used,
> > + then non-root partitioned tables are included, and a column is
> shown
> > + displaying the parent of each partitioned relation.
> >
> > Ah. I see. "non-root *partitined* tables". I misread the
> > phrase. Sorry for the noise.
>

I don't need to see root partitioned tables, because this table is empty.

> Well, is this decision an excellent one, from a UI perspective? I was
> surprised by this too and think this should be reconsidered.
>

> I would opt for having \d NOT show partitions at all, myself. When you
> have many partitions (and we're now making the system scale into the
> thousands for a single partitioned table), they clutter the output
> making it unusable. So, rather than think as \dP as "the way to show
> the aggregate size of a partitioned table or index", I'd think it as
> "the way to show detailed info about a partitioned table or index".
> Which includes things like displaying its list of partitions and the
> size of each.
>

I think so there can be more sensible perspectives how to watch partitioned
data, and how and where you would to see details.

For example - if you remove detail from \d command, then detail should be
displayed in some other command. Now, the detail is in \d and then I need
some aggregation - and it is \dP(*). For me it is not important if is
looking from left to right or from right to left if I see data that I need.
Personally, I have not strong opinion what should be best way - but I am
thinking so some aggregated information over all partitions is necessary.
Currently \d is complex enough, so I designed new command. Any time, this
will be complex task, because we should to display tree structure in a
table.

>
> --
> Álvaro Herrera https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-04-03 14:02:05 Re: [Patch] Mingw: Fix import library extension, build actual static libraries
Previous Message Fujii Masao 2019-04-03 13:47:54 Re: Re: reloption to prevent VACUUM from truncating empty pages at the end of relation