Re: [HACKERS] Runtime Partition Pruning
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Beena Emerson <memissemerson@gmail.com>, amul sul <sulamul@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-11-16T09:08:16Z
Lists: pgsql-hackers
On Wed, Nov 15, 2017 at 4:43 AM, David Rowley <david.rowley@2ndquadrant.com> wrote: > On 15 November 2017 at 01:57, David Rowley <david.rowley@2ndquadrant.com> wrote: >> I think to do this you're going to have to store some sort of array >> that maps the partition index to the subpath in the Append node so you >> can correctly identify the subpath based on what you're getting back >> from get_partitions_for_keys(). Perhaps what you had worked previously >> when we were not returning a Bitmapset with that function. >> >> Once you've got that design worked out I can take another look at this. > > So some sort of hierarchical structure of the partition hierarchy > would need to be stored in the Append node and then you'd need to > search at each level, and then somehow match the results up to the > subpaths that you have in the Append. Although, I'm still not sure > this is the best way to go about this. > Instead of hierarchical structure can’t we maintain an array (one entry per partition), and whenever any leaf partition’s subpath is added to the append rel (in function set_append_rel_pathlist) we can set that subpath number in corresponding array index. And, later we can add some wrapper over get_partitions_for_key such that it can recursively traverse the non-leaf partitions (something like get_partition_for_tuple does as Amit mentioned.). And, ultimately gives the output as a list of leaf partition's indexes. Then we can find the sub-plan number by looking into the array. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
Commits
-
Initialize ExprStates once in run-time partition pruning
- 1957f8dabf8d 11.0 landed
-
Add bms_prev_member function
- 5c0675215e15 11.0 landed
-
Support partition pruning at execution time
- 499be013de65 11.0 landed
-
Document partprune.c a little better
- 971d7ddbe19a 11.0 landed
-
Fix crash in pg_replication_slot_advance
- 6f1d723b6359 11.0 cited
-
Add parallel-aware hash joins.
- 1804284042e6 11.0 cited
-
Fix typo.
- 487a0c1518af 11.0 cited
-
Allow --with-bonjour to work with non-macOS implementations of Bonjour.
- 9b9cb3c4534d 11.0 cited
-
Mention need for --no-inc-recursive in rsync command
- 2c74e6c1dcc5 11.0 cited