Re: ToDo: show size of partitioned table

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: ToDo: show size of partitioned table
Дата
Msg-id 20190405232811.GA744@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: ToDo: show size of partitioned table  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: ToDo: show size of partitioned table  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Ordered Partitioned Table Scans
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Intermittent failure in InstallCheck-C "stat" test