pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_(total_)relation_size and partitioned tables
Date: Tue, 2 Jan 2018 08:45:34 -0500
Message-ID: <93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com> (raw)
In-Reply-To: <CAKJS1f86CjuW7-6QaXKPZLtcVCMo=ocprNdSk+dcvbpPyXMxtQ@mail.gmail.com>
References: <495cec7e-f8d9-7e13-4807-90dbf4eec4ea@lab.ntt.co.jp>
	<CA+TgmobG69Nf4E+VKcojXZQa9FRsbr7Dd+NORJRFMh5Umer98w@mail.gmail.com>
	<CAKJS1f9Rev615s4k7JhUsqwu-3CjR0xB2F0qpZ5fvQe+mxke0w@mail.gmail.com>
	<CAB7nPqQtNv5DLD9pXMWcT2VcsJqOnRUNBKekAapYiJxV4t=tyg@mail.gmail.com>
	<CAB7nPqTKy7HRpUM0_vMjGPkM6h6pR86Aegsw+MTmzxWr3-D-tg@mail.gmail.com>
	<1a78dea4-36b7-afb7-b3f3-1b4ff319fbb4@lab.ntt.co.jp>
	<d5323242-b571-9317-1e5b-ee5fd96c2f4a@2ndquadrant.com>
	<CAKJS1f86CjuW7-6QaXKPZLtcVCMo=ocprNdSk+dcvbpPyXMxtQ@mail.gmail.com>

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




view thread (25+ messages)  latest in thread

Message-ID: <93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com>
Permalink:  ../93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com/
Also on:    postgresql.org/message-id/93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, david.rowley@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, michael.paquier@gmail.com, robertmhaas@gmail.com
  Subject: Re: pg_(total_)relation_size and partitioned tables
  In-Reply-To: <93bef1b2-2ed0-c257-158e-efdf5b0ff9dd@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox