Re: About the constant-TRUE clause in reconsider_outer_join_clauses

2023-03-26 Thread Tom Lane
Richard Guo writes: > On Sat, Mar 25, 2023 at 11:41 PM Tom Lane wrote: >> Richard Guo writes: >>> Should we instead mark the constant-TRUE clause with required_relids >>> plus the OJ relid? >> I do not think it matters. > Yeah, I agree that it makes no difference currently. One day if we want

Re: About the constant-TRUE clause in reconsider_outer_join_clauses

2023-03-26 Thread Richard Guo
On Sat, Mar 25, 2023 at 11:41 PM Tom Lane wrote: > Richard Guo writes: > > Should we instead mark the constant-TRUE clause with required_relids > > plus the OJ relid? > > I do not think it matters. Yeah, I agree that it makes no difference currently. One day if we want to replace the is_pushe

Re: About the constant-TRUE clause in reconsider_outer_join_clauses

2023-03-25 Thread Tom Lane
Richard Guo writes: > Should we instead mark the constant-TRUE clause with required_relids > plus the OJ relid? I do not think it matters. > Even if the join does become clauseless, it will end up being an > unqualified nestloop. I think the join ordering algorithm will force > this join to be

About the constant-TRUE clause in reconsider_outer_join_clauses

2023-03-25 Thread Richard Guo
I happened to notice a constant-TRUE clause with is_pushed_down being true while its required_relids not including the OJ being formed, which seems abnormal to me. It turns out that this clause comes from reconsider_outer_join_clauses(), as a dummy replacement if we've generated a derived clause.