I thought this test wasn't too complete, because has_multiple_baserels isn't reached at all in many cases thanks to the way the calling if() is coded. I tried testing like this instead:
+ Assert(has_multiple_baserels(root) == (bms_membership(root->all_baserels) == BMS_MULTIPLE)); + /* * We can safely pass the outer tuple_fraction down to the subquery if the * outer level has no joining, aggregation, or sorting to do. Otherwise
and came to the same conclusion: check-world finds no cases where the assertion fails. So it LGTM too. Pushed.