Re: ToDo: show size of partitioned table

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ToDo: show size of partitioned table
Date: 2018-06-20 07:21:18
Message-ID: CAFj8pRC3FTx=1-Xsg5QWqK1=Fp9iS7oJROOYApiihGzOJqBuEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-06-20 7:44 GMT+02:00 Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>:

> On 2018/06/02 0:15, Ashutosh Bapat wrote:
> > I think we should at least display "Type" as "partitioned table" for a
> > partitioned table, so that it's easy to understand why the size is 0;
> > partitioned tables do not hold any data by themselves.
>
> There was a long discussion last year (during PG 10 beta period), such as
> [1], and it seems most of us agreed to doing the above. Maybe, we should
> finally do it for PG 12, if not PG 11.
>
> Regarding showing the size of partitioned tables, there are many opinions
> and it's not clear if showing it in \dt itself is appropriate. For one,
> there is no pg_relation_size() or pg_table_size() equivalent in the
> backend for aggregating the size of all tables in a partition tree and I
> think people are not quite on board about having such a function in the
> backend [2].
>

Now, the number of partitions can be low, but if the Postgres can better
process high number of partitions, then for some tables we can have
hundreds partitions.

Then usual \dt can be not too much usable. The aggregation can be done on
client side. But maybe this idea is premature. Now, for PG 12, we can start
with

\dtP+ command for showing partition tables only with aggregate size via all
related partitions.

Is it acceptable idea?

Regards

Pavel

>
> Thanks,
> Amit
>
> [1]
> https://www.postgresql.org/message-id/flat/7dfc13c5-d6b7-
> 1ff1-4bef-d75d6d2f76d9%40lab.ntt.co.jp
>
> [2]
> https://www.postgresql.org/message-id/flat/495cec7e-f8d9-
> 7e13-4807-90dbf4eec4ea%40lab.ntt.co.jp
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2018-06-20 07:30:31 New function pg_stat_statements_reset_query() to reset statistics of a specific query
Previous Message David Rowley 2018-06-20 07:07:54 Re: Parallel Aggregates for string_agg and array_agg