Re: pg_(total_)relation_size and partitioned tables

Поиск
Список
Период
Сортировка
Искать
От
David Rowley
Тема
Re: pg_(total_)relation_size and partitioned tables
Дата
Msg-id
CAKJS1f86CjuW7-6QaXKPZLtcVCMo=ocprNdSk+dcvbpPyXMxtQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
pg_(total_)relation_size and partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: pg_(total_)relation_size and partitioned tables Robert Haas <robertmhaas@gmail.com>
Re: pg_(total_)relation_size and partitioned tables David Rowley <david.rowley@2ndquadrant.com>
Re: pg_(total_)relation_size and partitioned tables Robert Haas <robertmhaas@gmail.com>
Re: pg_(total_)relation_size and partitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: pg_(total_)relation_size and partitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: pg_(total_)relation_size and partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: pg_(total_)relation_size and partitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: pg_(total_)relation_size and partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: pg_(total_)relation_size and partitioned tables David Rowley <david.rowley@2ndquadrant.com>
Re: pg_(total_)relation_size and partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: pg_(total_)relation_size and partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: pg_(total_)relation_size and partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables David Rowley <david.rowley@2ndquadrant.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Michael Paquier <michael.paquier@gmail.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Robert Haas <robertmhaas@gmail.com>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables Michael Paquier <michael.paquier@gmail.com>
On 29 December 2017 at 08:03, Peter Eisentraut
 wrote:
> Here is another idea.  If we had a function
>
> pg_partition_root(regclass) returns regclass
>
> (returning itself for non-partitioned relations), then users can easily
> construct queries to get the results they want in different shapes, e.g.,
>
> select pg_partition_root(c.oid), c.relname, pg_table_size(c.oid)
>   from pg_class c
>   order by 1
>
> select pg_partition_root(c.oid), sum(pg_table_size(c.oid))
>   from pg_class c
>   group by 1

That seems much nicer. I assume "root" would mean the top level
partitioned table. If so, would we also want
pg_partition_parent(regclass)? Or maybe something to control the
number of "levels-up" the function would run for. If we had that then
maybe -1 could mean "go until you find a table with no parent".

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-hackers по дате отправления
От: Stephen Frost
Дата:
От: Alvaro Herrera
Дата:
FAQ