Re: partition tree inspection functions - Mailing list pgsql-hackers

From Jesper Pedersen
Subject Re: partition tree inspection functions
Date
Msg-id 2780ebf9-99ae-b433-2d0c-dbca2995956a@redhat.com
Whole thread Raw
In response to Re: partition tree inspection functions  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: partition tree inspection functions  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Hi Amit,

On 07/26/2018 04:47 AM, Amit Langote wrote:
> Alright, I have replaced pg_partition_tree_tables with
> pg_partition_children with an 'include_all' argument, as you suggested,
> but I implemented it as an optional argument.  So, one would use that
> argument only if need to get *all* partitions.  I have also added a
> pg_partition_leaf_children() that returns just the leaf partitions, which
> wasn't there in the previous versions.
>

Great.

> Further, I've added a pg_partition_level that returns the level of a
> partition in the partition tree wrt to the root of the *whole* partition
> tree.  But maybe we want this function to accept one more argument,
> 'rootoid', the OID of the root table against which to measure the level?
> 

I don't think that is needed, or it should at least be an optional 
parameter.

>>> Maybe call it pg_partition_tree_leaf_count() or some such then?
>>
>> That could work.
> 
> OK, I fixed it to return just the count of leaf partitions and renamed it
> as such (pg_partition_children_leaf_count), but wonder if it's been made
> redundant by the addition of pg_partition_leaf_children.
> 

I think with pg_partition_leaf_children that we don't need the _count 
method, called pg_partition_tree_leaf_count in the docs, as we can just 
do a COUNT().

Best regards,
  Jesper


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: negative bitmapset member not allowed Error with partition pruning
Next
From: Cynthia Shang
Date:
Subject: Re: Allow COPY's 'text' format to output a header