Re: Fix bogus Asserts in calc_non_nestloop_required_outer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix bogus Asserts in calc_non_nestloop_required_outer
Date: 2024-01-09 16:58:21
Message-ID: 2195855.1704819501@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Jan 8, 2024 at 5:39 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think we're talking at cross-purposes. What I was wondering about
>> (at least further down in the thread) was whether we shouldn't be
>> checking *both* the "real" and the "parent" relids to make sure they
>> don't overlap the parameterization sets. But it's probably overkill.

> But we could also find some way to assert that the parameterization
> sets contain only top-most rels.

Hmm ... perhaps worth doing. I think bms_is_subset against
all_baserels would work.

>> However, I still don't like Richard's patch too much as-is, because
>> the Asserts are difficult to read/understand and even more difficult
>> to compare to the other code path. I think we want to keep the
>> nestloop and not-nestloop paths as visually similar as possible,
>> so I propose we do it more like the attached (where I also borrowed
>> some of your wording for the comments).

> I don't understand what this is parallel to;
> calc_nestloop_required_outer does no similar dance.

No, because the dance is done in its caller. The fact that these
two functions don't have more-similar argument lists is a bit of
a wart, perhaps.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-01-09 17:00:00 Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed
Previous Message Dean Rasheed 2024-01-09 16:51:31 Re: psql JSON output format