Re: Fix bogus Asserts in calc_non_nestloop_required_outer

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Richard Guo <guofenglinux@gmail.com>
Date: 2023-09-07T15:09:40Z
Lists: pgsql-hackers
Hi Richard,

> 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.

Probably it's just because of my limited experience with the optimizer
but I don't find the proposed change particularly straightforward. I
would suggest adding a comment before the Assert's and/or a detailed
commit message would be helpful.

Other than that I can confirm that both branches in the Assert's are
executed and the tests pass in different test environments.

--
Best regards,
Aleksander Alekseev



Commits

  1. Fix Asserts in calc_non_nestloop_required_outer().