Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-02T21:02:44Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes: > On Fri, 3 Oct 2025 at 04:18, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> 0001's change in is_dummy_rel() seems like a complete hack, especially >> since you didn't bother to change the adjacent comment. Why is that >> necessary? > build_setop_child_paths() wraps the child inputs in SubqueryScanPaths, > so we need to see through those. Ah. > 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. regards, tom lane
Commits
-
Fix UNION planner estimate_num_groups with varno==0
- eaa159632d03 19 (unreleased) landed
-
Fix possible usage of incorrect UPPERREL_SETOP RelOptInfo
- fdda78e361f1 19 (unreleased) landed
-
Teach planner to short-circuit EXCEPT/INTERSECT with dummy inputs
- 9c9d41af4db7 19 (unreleased) landed
-
Fix incorrect targetlist in dummy UNIONs
- 928df067d1e6 19 (unreleased) landed
-
Teach UNION planner to remove dummy inputs
- 03d40e4b523b 19 (unreleased) landed