Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2023-07-21T16:02:55Z
Lists: pgsql-hackers
Richard Guo <guofenglinux@gmail.com> writes: > This should be an oversight in 9df8f903. It seems that the new added > function add_outer_joins_to_relids() does not cope well with child > joins. The 'input_relids' for a child join is the relid sets of child > rels while 'othersj->min_xxxhand' refers to relids of parent rels. So > there would be problem when we add the relids of the pushed-down joins. Indeed. Adding the OJ relid itself works fine, but we won't get the required matches when we scan the join_info_list. > Instead of fixing add_outer_joins_to_relids() to cope with child joins, > I'm wondering if we can build join relids for a child join from its > parent by adjust_child_relids, something like attached. That looks like a good solid solution. Pushed with a bit of editorialization --- mostly, that I put the test case into partition_join.sql where there's already suitable test tables. regards, tom lane
Commits
-
Reduce memory used by partitionwise joins
- 513f4472a4a0 18.0 landed
-
Fix calculation of relid sets for partitionwise child joins.
- f75595cd80d1 16.0 landed
- 3c90dcd03914 17.0 landed