Re: ToDo: show size of partitioned table

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: ToDo: show size of partitioned table
Дата
Msg-id CAFj8pRC8-yMmoQ6WueDK2Bp=WbHWFbjkdJOgFZZ9dSxkr1-RLw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ToDo: show size of partitioned table  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: ToDo: show size of partitioned table  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers


2018-06-20 10:03 GMT+02:00 Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>:
On 2018/06/20 16:50, Pavel Stehule wrote:
> 2018-06-20 9:44 GMT+02:00 Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>:
>> Do you mean \dt continues to show size 0 for partitioned tables, but with
>> the new option (\dtP+) shows the actual size by aggregating across
>> partitions?  +1 to such a feature, but we need to agree on an acceptable
>> implementation for that.  How does the aggregation happen:
>>
>
> yes - my proposal is no change for \dt for now. I think so we will have to
> change it, when partitioning will be more common and number of partitions
> will be high. But it is not today.
>
> \dtP shows only partitions tables (like \dtS shows only system tables),
> with "+" shows sum of all related partitions.

Ah, okay.  That makes sense.

>> 1. In a new dedicated function in the backend (parallel to pg_table_size)?
>>
>> or
>>
>> 2. psql issues a separate query to compute the total size of a partition
>>    tree
>>
>
> In this moment we can simply do sum on client side, so it is related to @2.

I see, okay.

>> For option 2, I had posted a patch that simplifies writing such a query
>> and posted that here:
>>
>> https://www.postgresql.org/message-id/7a9c5328-5328-52a3-
>> 2a3d-bf1434b4dd1d%40lab.ntt.co.jp
>>
>> With that patch, the query to get the total size of a partition tree
>> becomes as simple as:
>>
>> select  sum(pg_table_size(p)) as size
>> from    pg_get_inheritance_tables('partitioned_table_name') p
>>
>
> good to know it. Thank you. Do you think so your patch should be included
> to this feature or will be processed independently?

It seems that it would be useful on its own, as people may want to do
various things once we provide them pg_get_inheritance_table.

ok

I'll prepare patch and I'll do note about dependency on your patch.

Regards

Pavel


Thanks,
Amit


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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: ToDo: show size of partitioned table
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"