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