Re: "failed to build any N-way joins" from a five-relation query

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: "failed to build any N-way joins" from a five-relation query
Date: 2026-10-14 06:02:29
Message-ID: CAMbWs48psgzcOw=V5ky+VKht+hV9+=GHO44-vNLRnuraGoXhAQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Oct 10, 2026 at 7:49 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> +1 to this idea, and I think we can take it one step further.
> root->initial_rels contains all the inputs of the current join search,
> base rels as well as sub-joinlist joinrels, so a single loop over it
> can replace the loop over simple_rel_array in v1. For each input that
> laterally references a rel found so far, we add all of its relids.
>
> Hence, the attached v2.

Pushed and back-patched to all supported branches. Thanks for all the
reviews.

- Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Manu 2026-10-14 06:04:54 Re: BUG #19686: Rolling back SET TABLESPACE
Previous Message harrisontbooth 2026-10-14 05:58:50 Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically