public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andrei Lepikhov <[email protected]>
To: Richard Guo <[email protected]>
To: David Rowley <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Memoize ANTI and SEMI JOIN inner
Date: Mon, 31 Mar 2025 11:46:08 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMbWs4_qE=j=KQ3bs8ryLCe4OPYbSaT+2RAVUaoj6vvxKrQDiQ@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<CAApHDvr2NRbjLXEUXvvKNCDcHfhC6UBL6ZmJzXZ29MBPi3+y8g@mail.gmail.com>
<CAMbWs4_qE=j=KQ3bs8ryLCe4OPYbSaT+2RAVUaoj6vvxKrQDiQ@mail.gmail.com>
On 3/31/25 11:03, Richard Guo wrote:
> On Thu, Mar 20, 2025 at 3:02 PM David Rowley <[email protected]> wrote:
>> For making this work, I think the attached should be about the guts of
>> the code changes. I didn't look at the comments. Right now I can't
>> think of any reason why this can't be done, but some experimentation
>> might reveal some reason that it can't.
>
> I reviewed this patch and I have some concerns about the following
> code:
>
> if (extra->inner_unique &&
> (inner_path->param_info == NULL ||
> bms_num_members(inner_path->param_info->ppi_serials) <
> list_length(extra->restrictlist)))
> return NULL;
>
> I understand that this check is used to ensure that the entire join
> condition is parameterized in the case of unique joins, so that we can
> safely mark the cache entry as complete after reading the first tuple.
> However, ppi_clauses includes join clauses available from all outer
> rels, not just the current outer rel, while extra->restrictlist only
> includes the restriction clauses for the current join. This means the
> check could pass even if a restriction clause isn't parameterized, as
> long as another join clause, which doesn't belong to the current join,
> is included in ppi_clauses.
Initially, I had the same concern. But if ppi_clauses contains a qual,
it should refer to this join and, as a result, be in the
extra->restrictlist, isn't it?
I thought about references to the other side of an OUTER JOIN, but if
the subquery refers to LHS, it just not be transformed to the SEMI/ANTI
join.
Anyway, if you provide an example or just a sketch, I will be happy to
discover it.
--
regards, Andrei Lepikhov
view thread (26+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Memoize ANTI and SEMI JOIN inner
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox