Re: ToDo: show size of partitioned table

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: ToDo: show size of partitioned table
Дата
Msg-id 20190408173754.GA9933@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  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
On 2019-Apr-08, Amit Langote wrote:

> I noticed that the size shown in the output of both \dP+ and \dPt+ does
> include toast relation sizes of (leaf) partitions, because
> pg_table_size(), which is used by all the queries that
> listPartitionedTables sends to the server, does:
> 
>     /*
>      * heap size, including FSM and VM
>      */
>     for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++)
>         size += calculate_relation_size(&(rel->rd_node), rel->rd_backend,
>                                         forkNum);
> 
>     /*
>      * Size of toast relation
>      */
>     if (OidIsValid(rel->rd_rel->reltoastrelid))
>         size += calculate_toast_table_size(rel->rd_rel->reltoastrelid);

Sigh.  I must have mixed up whether pg_table_size did include toast size
or not.  Anyway, I think \dP should report the same thing as \d, which I
think it's doing, so we're good there.

> >> Also, I think the new \dP should gain a new flag (maybe "l") to make it
> >> list leaf tables/indexes too with their local sizes, and remove those
> >> from the standard \d listing.
> > 
> > +1
> 
> +1 to the idea.  Perhaps we'd need to post this in a separate thread to
> highlight what may be a substantive change to \d's output?

Aye aye.

Not in a position to work on that right now; I might get to that in a
few days if nobody beats me to it.  (But then, I might not.)

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



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Pluggable Storage - Andres's take
Следующее
От: Andres Freund
Дата:
Сообщение: Re: change password_encryption default to scram-sha-256?