Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
Date
Msg-id bee34aec-659c-46f1-9ab7-7bbae0b7616c@gmail.com
Whole thread Raw
In response to Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
List pgsql-hackers
Hello David,

04.10.2025 06:55, David Rowley wrote:
> On Fri, 3 Oct 2025 at 10:02, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> David Rowley <dgrowleyml@gmail.com> writes:
>>> An alternative way would be to propagate those during build_setop_child_paths()
>> That answer works for me.  I was expecting you to just document the
>> need for the extra check in is_dummy_rel ;-) ... but this way is
>> perhaps better.
> So, I pushed the UNION portion earlier, but on hacking more on the
> EXCEPT/INTERSECT patch, I noticed that I don't have the target lists
> correct when marking the top-level set op as dummy. ...

Please look at a new anomaly, introduced with 03d40e4b5:
CREATE TABLE t(i integer);
CREATE TABLE pt(i integer) PARTITION BY LIST(i);

SET enable_seqscan = 'off';
SELECT * FROM t UNION SELECT * FROM t
UNION ALL
SELECT * FROM pt;
produces:
ERROR:  XX000: unrecognized node type: 0
LOCATION:  create_plan_recurse, createplan.c:538


Best regards.
Alexander



pgsql-hackers by date:

Previous
From: Steven Niu
Date:
Subject: Re: [PATCH] Add pretty formatting to pg_get_triggerdef
Next
From: Mats Kindahl
Date:
Subject: Re: Use stack-allocated StringInfoData