Re: ToDo: show size of partitioned table

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pavel(dot)stehule(at)gmail(dot)com, pryzby(at)telsasoft(dot)com, michael(at)paquier(dot)xyz, mathias(at)brossard(dot)org, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: ToDo: show size of partitioned table
Date: 2019-04-05 23:28:11
Message-ID: 20190405232811.GA744@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Apr-04, Amit Langote wrote:

> > 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.
>
> That might be a good idea, but maybe there isn't time left to revise the
> proposed patch like that for 12?

Well, the problem with designing psql commands incrementallyj is that
people are angry if you try to change what they show in a future
release. We only have one shot to get it right, pretty much.

Looking at the current proposal, I think I like \dPn+ very much -- it
shows the aggregated size of all partitioned tables. But I think \dP
(without the +) is almost completely useless. I'm not really sure about
having to add the "n" flag, but I suspect in practical use it's okay.

Also, I think \dPn+ shows partitioned tables, but \dPtn+ shows exactly
the same, so why do we have the "t" flag at all? We have \dPin+ which
shows aggregate size, but the only way to list both tables and indexes
is to add a pattern. I think this design was confusingly inspired by
the "list" vs. "describe" schizoid dichotomy of \d, without actually
getting any useful functionality in return.

IMO \dP should be "list partitioned relations with their sizes", and
\dPt "list partitioned tables with their sizes", and \dPi "list
partitioned indexes with their sizes". If no pattern is given, list
them all, otherwise only list those that match the pattern.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-04-05 23:44:40 Re: Intermittent failure in InstallCheck-C "stat" test
Previous Message Tom Lane 2019-04-05 23:26:32 Re: Ordered Partitioned Table Scans