Re: [HACKERS] Runtime Partition Pruning
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Robert Haas <robertmhaas@gmail.com>,
Beena Emerson <memissemerson@gmail.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>, amul sul <sulamul@gmail.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Dilip Kumar <dilipbalaut@gmail.com>
Date: 2017-12-18T08:51:02Z
Lists: pgsql-hackers
On 2017/12/09 0:57, Robert Haas wrote: > On Thu, Dec 7, 2017 at 2:22 AM, Beena Emerson <memissemerson@gmail.com> wrote: >> I have added the partition quals that are used for pruning. >> >> PFA the updated patch. I have changed the names of variables to make >> it more appropriate, along with adding more code comments and doing >> some refactoring and other code cleanups. > > - I am surprised that set_append_subplan_indexes() needs to worry > about multi-level partitioning directly. I would have thought that > Amit's patch would take care of that, just returning a Bitmapset of > indexes which this function could use directly. Actually, the partition.c code that my patch adds is limited to consider one partitioned table at a time, not the whole tree. As of 0a480502b09 [1], we call set_append_rel_size() separately for each partitioned table in a partition tree. In each such call, we call partition.c to perform partition pruning for the given partitioned table. In the run-time pruning case, we should get, via Append, a list of pruning clauses for each partitioned table in the tree that survived plan-time pruning. Then, just like ExecFindPartition() calls get_partition_for_tuple() for each partitioned table until we get to a leaf partition, we should call partition.c for each un-pruned partitioned table that have run-time pruning clauses associated. Thanks, Amit [1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=0a480502b09
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