Re: pg_(total_)relation_size and partitioned tables - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_(total_)relation_size and partitioned tables
Date
Msg-id 93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com
Whole thread Raw
In response to Re: pg_(total_)relation_size and partitioned tables  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: pg_(total_)relation_size and partitioned tables
Re: [Sender Address Forgery]Re: pg_(total_)relation_size andpartitioned tables
List pgsql-hackers
On 12/28/17 16:24, David Rowley wrote:
>> select pg_partition_root(c.oid), c.relname, pg_table_size(c.oid)
>>   from pg_class c
>>   order by 1
>>
>> select pg_partition_root(c.oid), sum(pg_table_size(c.oid))
>>   from pg_class c
>>   group by 1
> 
> That seems much nicer. I assume "root" would mean the top level
> partitioned table. If so, would we also want
> pg_partition_parent(regclass)? Or maybe something to control the
> number of "levels-up" the function would run for. If we had that then
> maybe -1 could mean "go until you find a table with no parent".

Hmm, we need to think through some scenarios for what one would really
want to do with this functionality.

Clearly, the existing behavior is useful for management tasks like bloat
and vacuum monitoring.

And on the other hand you might want to have a logical view of, how big
is this partitioned table altogether.

But what are the uses for dealing with partial partition hierarchies?
How easy do we need to make that?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Devrim Gündüz
Date:
Subject: Re: How to Works with Centos
Next
From: "Tels"
Date:
Subject: Re: Faster inserts with mostly-monotonically increasing values