From: | Andrei Lepikhov <lepihov(at)gmail(dot)com> |
---|---|
To: | Richard Guo <guofenglinux(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Memoize ANTI and SEMI JOIN inner |
Date: | 2025-03-31 09:46:08 |
Message-ID: | 1b356b61-3a2a-490a-bf9a-6340a1ec004a@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 3/31/25 11:03, Richard Guo wrote:
> On Thu, Mar 20, 2025 at 3:02 PM David Rowley <dgrowleyml(at)gmail(dot)com> 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
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Guo | 2025-03-31 09:50:04 | Re: Memoize ANTI and SEMI JOIN inner |
Previous Message | David Rowley | 2025-03-31 09:39:14 | Re: Memoize ANTI and SEMI JOIN inner |