As stated in [1], all paths arriving here are parameterized by top parents, so we should check against top_parent_relids if it exists in the two Asserts.
Attached is a patch fixing that. [1] https://www.postgresql.org/message-id/CAMbWs4_UoVcCwkVMfi9TjSC%3Do5U6BRHUNZiVhrvSbDfU2HaeDA%40mail.gmail.com Thanks Richard
v1-0001-Fix-bogus-Asserts-in-calc_non_nestloop_required_outer.patch
Description: Binary data