Re: BUG #18904: INTERSECT with an impossible where should eliminate both from the query plan

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "jh(dot)lai(at)qq(dot)com" <jh(dot)lai(at)qq(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18904: INTERSECT with an impossible where should eliminate both from the query plan
Date: 2025-04-29 11:57:57
Message-ID: CAApHDvrH7U=jDci=uyPx_TK8bPo4Xfy41q6LvqS6n-5QNO7_sQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, 28 Apr 2025 at 06:02, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Anyway, as David said, this is not a bug. If it's something you
> really want to see happen, try writing a patch yourself.

This is already somewhat better in v18 thanks to [1].
generate_nonunion_paths() already has some code to put the smallest
child on the left, and the recent changes in nodeSetOp.c means very
little work will be done when the left side is empty.

David

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=276279295

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jinhui Lai 2025-04-29 12:13:31 Re: BUG #18904: INTERSECT with an impossible where should eliminateboth from the query plan
Previous Message Andrei Lepikhov 2025-04-29 11:14:39 Incorrect calculation of path fraction value in MergeAppend