Skip to content

Jppd 16 - #98

Open
reshke wants to merge 3 commits into
REL_16_STABLEfrom
jppd_16
Open

Jppd 16#98
reshke wants to merge 3 commits into
REL_16_STABLEfrom
jppd_16

Conversation

@reshke

@reshke reshke commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

hlinnaka and others added 3 commits July 21, 2026 09:06
We don't normally push down join quals into subqueries, because that would
require creating parameterized plans. However, if the plan is already
parameterized because it's LATERAL, we might as well push down any
additional join quals, that refer the same relations that are already
referenced within the subquery.

This changes the behavior of the sublevels_up parameters to
ReplaceVarsFromTargetList(). The targetlist entries used to replace vars are
no longer offset by that amount. I'm not sure what the original thinking
on it was, but all the existing callers passed sublevels_up = 0, so I hope
this is OK..

XXX: fixes by reshke
Plan subqueries a second time, to create parameterized plans with join
quals.

XXX: fixes by reshke
Introduce a planner GUC, enable_join_predicate_pushdown (default on),
that controls whether join and equivalence-class quals are pushed down
into LATERAL subqueries.  Plain restriction-qual pushdown is unaffected.

This gives an escape hatch to disable the optimization and lets the
regression tests compare plans and results with and without it.

Extend subselect_pushdown with cases that toggle the GUC, verify that
restriction quals are still pushed when it is off, and assert that the
result set is identical with the optimization on and off (via a
symmetric EXCEPT ALL).  Update sysviews expected output for the new
setting.

XXX: fixes by reshke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants