Re: Assert !bms_overlap(joinrel->relids, required_outer)

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Assert !bms_overlap(joinrel->relids, required_outer)
Дата
Msg-id CAMbWs4_UoVcCwkVMfi9TjSC=o5U6BRHUNZiVhrvSbDfU2HaeDA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Assert !bms_overlap(joinrel->relids, required_outer)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Assert !bms_overlap(joinrel->relids, required_outer)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On Wed, Jun 28, 2023 at 10:09 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Those cases will go through calc_non_nestloop_required_outer
which has

        /* neither path can require rels from the other */
        Assert(!bms_overlap(outer_paramrels, inner_path->parent->relids));
        Assert(!bms_overlap(inner_paramrels, outer_path->parent->relids));

Looking at these two assertions it occurred to me that shouldn't we
check against top_parent_relids for an otherrel since paths are
parameterized by top-level parents?  We do that in try_nestloop_path.

    /* neither path can require rels from the other */
-   Assert(!bms_overlap(outer_paramrels, inner_path->parent->relids));
-   Assert(!bms_overlap(inner_paramrels, outer_path->parent->relids));
+   Assert(!bms_overlap(outer_paramrels,
+                       inner_path->parent->top_parent_relids ?
+                       inner_path->parent->top_parent_relids :
+                       inner_path->parent->relids));
+   Assert(!bms_overlap(inner_paramrels,
+                       outer_path->parent->top_parent_relids ?
+                       outer_path->parent->top_parent_relids :
+                       outer_path->parent->relids));

This is not related to the issue being discussed here.  Maybe it should
be a separate issue.

Thanks
Richard

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: ReadRecentBuffer() doesn't scale well
Следующее
От: John Morris
Дата:
Сообщение: Unified File API