aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan/analyzejoins.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-05-11 13:44:25 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-05-11 13:44:25 -0400
commitc8b881d21fd8e0214bc43280d6231cc2c6ef55ef (patch)
treebd6fec7e5949d37acefb6f00c6337a1420b78cd1 /src/backend/optimizer/plan/analyzejoins.c
parent375407f4940ba0922513666f00852c54943eb1a0 (diff)
downloadpostgresql-c8b881d21fd8e0214bc43280d6231cc2c6ef55ef.tar.gz
postgresql-c8b881d21fd8e0214bc43280d6231cc2c6ef55ef.zip
Undo faulty attempt at not relying on RINFO_IS_PUSHED_DOWN.
I've had a bee in my bonnet for some time about getting rid of RestrictInfo.is_pushed_down, because it's squishily defined and requires not-inexpensive extra tests to use (cf RINFO_IS_PUSHED_DOWN). In commit 2489d76c4, I tried to make remove_rel_from_query() not depend on that macro; but the replacement test is buggy, as exposed by a report from Rushabh Lathia and Robert Haas. That change was pretty incidental to the main goal of 2489d76c4, so let's just revert it for now. (Getting rid of is_pushed_down is still far away, anyway.) Discussion: https://postgr.es/m/CA+TgmoYco=hmg+iX1CW9Y1_CzNoSL81J03wUG-d2_3=rue+L2A@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/plan/analyzejoins.c')
-rw-r--r--src/backend/optimizer/plan/analyzejoins.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/backend/optimizer/plan/analyzejoins.c b/src/backend/optimizer/plan/analyzejoins.c
index 98cf3494e6f..657b6e59074 100644
--- a/src/backend/optimizer/plan/analyzejoins.c
+++ b/src/backend/optimizer/plan/analyzejoins.c
@@ -466,12 +466,7 @@ remove_rel_from_query(PlannerInfo *root, int relid, int ojrelid,
remove_join_clause_from_rels(root, rinfo, rinfo->required_relids);
- /*
- * If the qual lists ojrelid in its required_relids, it must have come
- * from above the outer join we're removing (so we need to keep it);
- * if it does not, then it didn't and we can discard it.
- */
- if (bms_is_member(ojrelid, rinfo->required_relids))
+ if (RINFO_IS_PUSHED_DOWN(rinfo, joinrelids))
{
/*
* There might be references to relid or ojrelid in the