Re: BUG #18429: Inconsistent results on similar queries with join lateral

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Benoit Ryder <b(dot)ryder(at)ateme(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18429: Inconsistent results on similar queries with join lateral
Date: 2024-04-12 15:57:58
Message-ID: CAKFQuwZVGb335kR9hUednKd-Rnkf4t29nRsTS2Wgn0jJzfu7jA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Apr 12, 2024 at 8:50 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Benoit Ryder <b(dot)ryder(at)ateme(dot)com> writes:
> > Would you know a way to avoid this bug? I could probably tweak the query
> > until the result is looking good, but I would prefer to make sure the
> > bug won't reappear if the query is used with different data or context.
>
> I'm not seeing a bulletproof way offhand, other than "update to v16".
> Disabling nestloop plans fixes your Q4 in the back branches, but not
> Q1 (because there's no opportunity for a hash or merge join in Q1).
>
>
Q1 is trivially fixed by specifying "WITH c2 AS MATERIALIZED ( ... )", No?
Which is why it isn't broken in 9.4 and any of the other versions where we
materialized CTEs by default.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2024-04-12 17:14:31 BUG #18430: syntax error when using aggregate function in where clause of subquery
Previous Message Tom Lane 2024-04-12 15:50:02 Re: BUG #18429: Inconsistent results on similar queries with join lateral