pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: partition tree inspection functions
Date: Thu, 28 Jun 2018 12:37:14 +0200
Message-ID: <d3dfbc48-ebfe-79ed-3a44-f81880e6aba6@2ndquadrant.com> (raw)
In-Reply-To: <e0762082-09fc-030d-15e5-ee450d63b440@lab.ntt.co.jp>
References: <8d00e51a-9a51-ad02-d53e-ba6bf50b2e52@lab.ntt.co.jp>
	<b24e77c4-3ac1-7c2e-9359-629385578175@2ndquadrant.com>
	<e0762082-09fc-030d-15e5-ee450d63b440@lab.ntt.co.jp>

On 6/28/18 10:59, Amit Langote wrote:
> On 2018/06/28 17:40, Peter Eisentraut wrote:
>> On 6/26/18 07:08, Amit Langote wrote:
>>> As discussed a little while back [1] and also recently mentioned [2], here
>>> is a patch that adds a set of functions to inspect the details of a
>>> partition tree.  There are three functions:
>>>
>>> pg_partition_parent(regclass) returns regclass
>>> pg_partition_root_parent(regclass) returns regclass
>>> pg_partition_tree_tables(regclass) returns setof regclass
>>
>> Does this add anything over writing a recursive query on pg_inherits?
> 
> As far as the information output is concerned, it doesn't.

I'm thinking, an SQL query might be more efficient if you want to
qualify the query further.  For example, give me all tables in this tree
that match '2018'.  If you wrote your functions as SQL-language
functions, the optimizer could perhaps inline them and optimize them
further.

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




view thread (74+ messages)  latest in thread

Message-ID: <d3dfbc48-ebfe-79ed-3a44-f81880e6aba6@2ndquadrant.com>
Permalink:  ../d3dfbc48-ebfe-79ed-3a44-f81880e6aba6@2ndquadrant.com/
Also on:    postgresql.org/message-id/d3dfbc48-ebfe-79ed-3a44-f81880e6aba6@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, Langote_Amit_f8@lab.ntt.co.jp
  Subject: Re: partition tree inspection functions
  In-Reply-To: <d3dfbc48-ebfe-79ed-3a44-f81880e6aba6@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