Re: Assert failure in try_nestloop_path()

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tender Wang <tndrwang(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Assert failure in try_nestloop_path()
Date: 2026-09-29 07:20:15
Message-ID: CAMbWs4_KT4LGcxS4oyoHsTTfTdw_evJ0DdWcaejDi9hbSp0dXg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 27, 2026 at 1:00 AM Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:
> I've discovered that:
> echo "geqo_threshold = 2" >/tmp/temp.config
> TEMP_CONFIG=/tmp/temp.config TESTS="partition_join" make -s check-tests
>
> triggers one of the assertions:
> TRAP: failed Assert("no_duplicate_clause_serials(*restrict_clauses)"), File: "relnode.c", Line: 2079, PID: 634394

Thanks for the report. I think the culprit is that during GEQO join
planning, add_child_join_rel_equivalences() will re-add the same child
EC members in each GEQO round, since it has no concept that the
members it wants might be there already. As a result, in the reported
case, the same EC member PHV(COALESCE(t3_p1.c, t4.c)) appears three
times in the same EC. So, in get_joinrel_parampathinfo(), the
generate_join_implied_equalities() call generate two identical
RestrictInfos for "PHV(...) = PHV(...)".

I think we need to do something to avoid generating duplicate EC
members in add_child_join_rel_equivalences().

- Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-29 07:26:41 Re: Stabilize and shorten test_checksums/013_rewind test
Previous Message Hayato Kuroda (Fujitsu) 2026-09-29 07:10:38 RE: ReplicationSlotRelease() clobbers another backend's statusFlags entry