Re: Memoize ANTI and SEMI JOIN inner
От | Andrei Lepikhov |
---|---|
Тема | Re: Memoize ANTI and SEMI JOIN inner |
Дата | |
Msg-id | 1b356b61-3a2a-490a-bf9a-6340a1ec004a@gmail.com обсуждение исходный текст |
Ответ на | Re: Memoize ANTI and SEMI JOIN inner (Richard Guo <guofenglinux@gmail.com>) |
Ответы |
Re: Memoize ANTI and SEMI JOIN inner
|
Список | pgsql-hackers |
On 3/31/25 11:03, Richard Guo wrote: > On Thu, Mar 20, 2025 at 3:02 PM David Rowley <dgrowleyml@gmail.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
В списке pgsql-hackers по дате отправления: