Re: BUG #18904: INTERSECT with an impossible where should eliminate both from the query plan - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #18904: INTERSECT with an impossible where should eliminate both from the query plan
Date
Msg-id CAApHDvrH7U=jDci=uyPx_TK8bPo4Xfy41q6LvqS6n-5QNO7_sQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18904: INTERSECT with an impossible where should eliminate both from the query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #18904: INTERSECT with an impossible where should eliminateboth from the query plan
List pgsql-bugs
On Mon, 28 Apr 2025 at 06:02, Tom Lane <tgl@sss.pgh.pa.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



pgsql-bugs by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Incorrect calculation of path fraction value in MergeAppend
Next
From: "Jinhui Lai"
Date:
Subject: Re: BUG #18904: INTERSECT with an impossible where should eliminateboth from the query plan