Re: partition tree inspection functions
От | Amit Langote |
---|---|
Тема | Re: partition tree inspection functions |
Дата | |
Msg-id | 9f371b71-7b4f-b51c-323c-ca62c4a4ffed@lab.ntt.co.jp обсуждение исходный текст |
Ответ на | Re: partition tree inspection functions (Jesper Pedersen <jesper.pedersen@redhat.com>) |
Ответы |
Re: partition tree inspection functions
|
Список | pgsql-hackers |
Hi Jesper, Thanks for the quick feedback. On 2018/07/27 1:30, Jesper Pedersen wrote: > On 07/26/2018 04:47 AM, Amit Langote wrote: >> 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. Optional parameter sounds good, so made it get_partition_level(regclass [ , regclass ]) in the updated patch. Although, adding that argument is not without possible surprises its result might evoke. Like, what happens if you try to find the level of the root table by passing a leaf partition oid for the root table argument, or pass a totally unrelated table for the root table argument. For now, I've made the function return 0 for such cases. >> 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(). Ah, okay. Removed pg_partition_tree_leaf_count. Thanks, Amit
Вложения
В списке pgsql-hackers по дате отправления: