Re: Partition-wise join for join between (declaratively) partitioned tables
Robert Haas <robertmhaas@gmail.com>
On Mon, Mar 20, 2017 at 9:44 AM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote: >> I believe it would also be best to include 0011's changes to >> adjust_appendrel_attrs_multilevel in 0001. > > The function needs to repeat the "adjustment" process for every > "other" relation (join or base) that it encounters, by testing using > OTHER_BASE_REL or OTHER_JOINREL in short IS_OTHER_REL(). The last > macros are added by the partition-wise join implementation patch 0005. > It doesn't make sense to add that macro in 0001 OR modify that > function twice, once in 0001 and then after 0005. So, I will leave it > to be part of 0011, where the changes are actually needed. Hmm. I would kind of like to move the IS_JOIN_REL() and IS_OTHER_REL() stuff to the front of the series. In other words, I propose that we add those macros first, each testing for only the one kind of RelOptInfo that exists today, and change all the code to use them. Then, when we add child joinrels, we can modify the macros at the same time. The problem with doing it the way you have it is that those changes will have to be squashed into the main partitionwise join commit, because otherwise stuff will be broken. Doing it the other way around lets us commit that bit separately. > Done. Now SQL file has 325 lines and output has 1697 lines as against > 515 and 4085 lines resp. earlier. Sounds reasonable. > Now that that purpose has served, I have reordered the > patches so that test patch comes after the implementation and follow > on fixes. Sounds good. > There are two ways to fix it, > > 1. when we create a reparameterized path add it to the list of paths, > thus the parameterization bubbles up the join tree. But then we will > be changing the path list after set_cheapest() has been called OR may > be throwing out paths which other paths refer to. That's not > desirable. May be we can save this path in another list and create > join paths using this path instead of reparameterizing existing join > paths. > 2. Add code to reparameterize_path() to handle join paths, and I think > all kinds of paths since we might have trickle the parameterization > down the joining paths which could be almost anything including > sort_paths, unique_paths etc. That looks like a significant effort. I > think, we should attack it separately after the stock partition-wise > join has been committed. I don't understand #1. #2 sounds like what I was expecting. I agree it can be postponed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Basic partition-wise join functionality.
- f49842d1ee31 11.0 landed
-
Assorted preparatory refactoring for partition-wise join.
- e139f1953f29 11.0 landed
-
Teach adjust_appendrel_attrs(_multilevel) to do multiple translations.
- 480f1f4329f1 11.0 landed
-
Stamp 10beta2.
- 42171e2cd23c 10.0 cited
-
Eat XIDs more efficiently in recovery TAP test.
- 08aed6604de2 10.0 cited
-
Abstract logic to allow for multiple kinds of child rels.
- 7a39b5e4d112 10.0 landed
-
Implement SortSupport for macaddr data type
- f90d23d0c518 10.0 cited
-
Attempt to stabilize grouping sets regression test plans.
- de4da168d57d 10.0 cited
-
Teach xlogreader to follow timeline switches
- 1148e22a82ed 10.0 cited
-
Don't scan partitioned tables.
- d3cc37f1d801 10.0 cited
-
Fix grammar.
- b4ff8609dbad 10.0 cited
-
postgres_fdw: Push down FULL JOINs with restriction clauses.
- b30fb56b07a8 10.0 cited
-
Some preliminary refactoring towards partitionwise join.
- c44c47a773bd 10.0 landed
-
contrib/amcheck needs RecentGlobalXmin to be PGDLLIMPORT'ified.
- 56018bf26eec 10.0 cited
-
Print test parameters like "foo: 123", and results like "foo = 123".
- 2a7f4f76434d 10.0 cited