Re: ToDo: show size of partitioned table

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: ToDo: show size of partitioned table
Дата
Msg-id 20190207150317.GA31320@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: ToDo: show size of partitioned table  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: ToDo: show size of partitioned table  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On 2019-Feb-07, Pavel Stehule wrote:

> Your example
> 
> postgres=# \dPtn+
>                      List of partitioned tables
> ┌────────┬────────┬───────┬─────────────┬────────────┬─────────────┐
> │ Schema │  Name  │ Owner │ Parent name │    Size    │ Description │
> ╞════════╪════════╪═══════╪═════════════╪════════════╪═════════════╡
> │ public │ p      │ pavel │             │ 8192 bytes │             │
> │ public │ p_1    │ pavel │ p           │ 8192 bytes │             │
> │ public │ p_1_bc │ pavel │ p_1         │ 8192 bytes │             │
> └────────┴────────┴───────┴─────────────┴────────────┴─────────────┘
> (3 rows)
> 
> I hope so the interpretation is clean .. there are three partitioned tables
> (two are subpartitioned tables). Any partitioned table has assigned 8KB of
> data.
> 
> We can introduce new column "size with sub partitions" where these numbers
> can be counted together. But for term "size" I expect valid rule S1+S2+..
> SN = total size.

Right now, a partitioned table has no size of its own; its only storage
is in its children.  But that might change in the future, for example if
we implement global indexes.  Then it will be useful to show these sizes
separately.

I suggest that we should have one column for the aggregated size of its
children, and another column for the "local" size.  So currently the
local size would always be zero for partitioned tables.  The other
column (maybe "Children Size") would be the sum of the sizes of all its
partitions.

So I think this should be:

                      List of partitioned tables
 ┌────────┬────────┬───────┬─────────────┬────────────┬───────────────┬────────────
 │ Schema │  Name  │ Owner │ Parent name │    Size    │ Children Size │ Description 
 ╞════════╪════════╪═══════╪═════════════╪════════════╪═══════════════╡
 │ public │ p      │ pavel │             │            │    8192 bytes │
 │ public │ p_1    │ pavel │ p           │            │    8192 bytes │
 │ public │ p_1_bc │ pavel │ p_1         │ 8192 bytes │               │
 └────────┴────────┴───────┴─────────────┴────────────┴───────────────┴─────────────



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


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: phase out ossp-uuid?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] REINDEX CONCURRENTLY 2.0