Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables
Дата
Msg-id 20180120101454.GA1311@paquier.xyz
обсуждение исходный текст
Ответ на 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
Список pgsql-hackers
On Fri, Jan 19, 2018 at 06:28:41PM +0900, Amit Langote wrote:
> Do you mean pg_partition_tree(regclass), that returns all partitions in
> the partition tree whose root is passed as the parameter?
>
> Perhaps, like the following (roughly implemented in the attached)?
>
> select  pg_partition_root(p) as root_parent,
>         pg_partition_parent(p) as parent,
>         p as relname,
>         pg_total_relation_size(p) as size
> from    pg_partition_tree_tables('p') p
> order by 4;
>  root_parent | parent | relname |  size
> -------------+--------+---------+---------
>  p           |        | p       |       0
>  p           | p      | p123    |       0
>  p           | p123   | p12     |       0
>  p           | p123   | p3      | 3653632
>  p           | p12    | p1      | 3653632
>  p           | p12    | p2      | 3653632
> (6 rows)

It seems that you caught the idea. As long as each leaf and root is
listed uniquely, that would be acceptable to me, and useful for users.
If pg_partition_tree_tables() uses the top of the partition as input,
all the tree should show up. If you use a leaf, anything under the leaf
should show up. If a leaf is defined and it has no underlying leaves,
then only this outmost leaf should be listed.

+/*
+ * Returns Oids of tables in a publication.
+ */
Close enough, but that's not a publication.

>> Documentation, as well as regression tests, would be welcome :)
>
> OK, I will add those things in the next version.

Thanks.
--
Michael

Вложения

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

Предыдущее
От: Jing Wang
Дата:
Сообщение: Re: [HACKERS] Support to COMMENT ON DATABASE CURRENT_DATABASE
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: [HACKERS] Supporting huge pages on Windows