Re: Assert failure in get_baserel_parampathinfo with lateral UNION ALL

From: wenhui qiu <qiuwenhuifx(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Assert failure in get_baserel_parampathinfo with lateral UNION ALL
Date: 2026-09-21 07:30:35
Message-ID: CAGjGUALJb3qyXByCdf6p62fq0EbMnOSAkct_Ny0w9=bXnRzdig@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

HI Richard

I think the change to derive `clause_relids` from the child EMs makes
> sense, especially for the lateral-reference case described in the patch.
> One thing I may be missing, though: after replacing
> `rinfo->clause_relids`, should we also update `rinfo->num_base_rels`?
> `make_restrictinfo()` computes `num_base_rels` from the original
> `clause_relids`, but this patch subsequently replaces `clause_relids` for
> child clauses.
> In cases involving lateral references and nulling outer joins, the two
> sets can be different, so `num_base_rels` could potentially become stale.
> Would it be safer to recompute it from the new `clause_relids` here, using
> the same definition as in `make_restrictinfo()`?
> I am not sure whether there is an invariant elsewhere that makes
> `num_base_rels` unaffected in these cases. I
> t might also be useful to add a regression case specifically covering this
> metadata, in addition to the existing plan/execution coverage.
>

Thanks

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-09-21 07:30:59 Re: [Patch] Fix pg_get_multixact_stats() over-reporting members on a hot standby
Previous Message Heikki Linnakangas 2026-09-21 07:19:47 Re: [Patch] Fix pg_get_multixact_stats() over-reporting members on a hot standby