On 23/2/2023 11:36, Richard Guo wrote:
> I've realized this hack is not correct :-(. References to A Vars and B
> Vars in higher qual levels do not need this adjustment. So this code
> change would add unnecessary relids for clauses that involve A Vars or B
> Vars but not C Vars, resulting them being placed at higher place than
> needed.
>
> Maybe what we need is to add in commute_below_l (assuming it has been
> recorded in SpecialJoinInfo) rather than commute_below of outer joins
> mentioned within the clause?
Doing a comparison of pg15 and master initsplan.c I found that a clear
and documented algorithm for delaying the application of a qual is lost
or replaced with some commute_* fields.
It is not clear how we guarantee correct application delay of a qual.
Which part of the code implements it now?
--
regards,
Andrey Lepikhov
Postgres Professional