David Rowley <dgrowleyml@gmail.com> writes:
> The first bad commit seems to be b448f1c8
Yeah, I think the proximate cause is the removal of the delay_upper_joins
restrictions in analyzejoins.c. That allows us to remove the join to
ref_0, which prior versions didn't do; but then that exposes the need to
clean up dead references in EquivalenceClasses. I'm wondering a bit
now if there are variants of this that'd fail in pre-v16 branches.
It's not obvious to me offhand why delay_upper_joins would have prevented
all cases where a removable rel could be mentioned in an EquivalenceClass
member (presumably via the ph_rels set of a PHV).
regards, tom lane