Re: Partition-wise join for join between (declaratively) partitioned tables
Rafia Sabih <rafia.sabih@enterprisedb.com>
On Wed, Mar 22, 2017 at 3:19 PM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote: >>>> >> In an attempt to test the geqo side of this patch, I reduced >> geqo_threshold to 6 and set enable_partitionwise_join to to true and >> tried following query, which crashed, >> >> explain select * from prt, prt2, prt3, prt32, prt4, prt42 where prt.a >> = prt2.b and prt3.a = prt32.b and prt4.a = prt42.b and prt2.a > 1000 >> order by prt.a desc; >> >> Stack-trace for the crash is as follows, >> > Nice catch. When reparameterize_path_by_child() may be running in a > temporary memory context while running in GEQO mode. It may add a new > PPI to base relation all in the temporary context. In the next GEQO > cycle, the ppilist will be clobbered since the temporary context is > reset for each geqo cycle. The fix is to allocate PPI in the same > memory context as the RelOptInfo similar to mark_dummy_rel(). > > I also found another problem. In geqo, we never call > generate_partition_wise_join_paths() which set cheapest paths for each > child-join. Because of this cheapest_*_paths are never set for those > rels, thus segfaulting in functions like sort_inner_and_outer() which > use those. > > Here's patch fixing both the issues. Please let me know if it fixes > the issues you are seeing. I tested the applied patch, it is fixing the reported issue. -- Regards, Rafia Sabih EnterpriseDB: http://www.enterprisedb.com/
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