0001-Disable-JOIN_SEMI-and-JOIN_RIGHT_SEMI-paths.patch
text/x-patch
Filename: 0001-Disable-JOIN_SEMI-and-JOIN_RIGHT_SEMI-paths.patch
Type: text/x-patch
Part: 2
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0001
Subject: Disable 'JOIN_SEMI' and 'JOIN_RIGHT_SEMI' paths
| File | + | − |
|---|---|---|
| src/backend/optimizer/path/joinrels.c | 19 | 16 |
From 9ba6ea7c742b7985b43c8de463b6959f4e16c400 Mon Sep 17 00:00:00 2001
From: Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Date: Fri, 22 Aug 2025 16:43:14 +0300
Subject: [PATCH] Disable 'JOIN_SEMI' and 'JOIN_RIGHT_SEMI' paths
This patch disables creation of SEMI/RIGHT-SEMI paths in order to make
reproducing the bug easier.
---
src/backend/optimizer/path/joinrels.c | 35 +++++++++++++++------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/src/backend/optimizer/path/joinrels.c b/src/backend/optimizer/path/joinrels.c
index 535248aa525..aded9e11b83 100644
--- a/src/backend/optimizer/path/joinrels.c
+++ b/src/backend/optimizer/path/joinrels.c
@@ -972,22 +972,25 @@ populate_joinrel_with_paths(PlannerInfo *root, RelOptInfo *rel1,
* then do an innerjoin (see comments in join_is_legal). In the
* latter case we can't apply JOIN_SEMI joining.
*/
- if (bms_is_subset(sjinfo->min_lefthand, rel1->relids) &&
- bms_is_subset(sjinfo->min_righthand, rel2->relids))
- {
- if (is_dummy_rel(rel1) || is_dummy_rel(rel2) ||
- restriction_is_constant_false(restrictlist, joinrel, false))
- {
- mark_dummy_rel(joinrel);
- break;
- }
- add_paths_to_joinrel(root, joinrel, rel1, rel2,
- JOIN_SEMI, sjinfo,
- restrictlist);
- add_paths_to_joinrel(root, joinrel, rel2, rel1,
- JOIN_RIGHT_SEMI, sjinfo,
- restrictlist);
- }
+
+ /*
+ * if (bms_is_subset(sjinfo->min_lefthand, rel1->relids) &&
+ * bms_is_subset(sjinfo->min_righthand, rel2->relids))
+ * {
+ * if (is_dummy_rel(rel1) || is_dummy_rel(rel2) ||
+ * restriction_is_constant_false(restrictlist, joinrel, false))
+ * {
+ * mark_dummy_rel(joinrel);
+ * break;
+ * }
+ * add_paths_to_joinrel(root, joinrel, rel1, rel2,
+ * JOIN_SEMI, sjinfo,
+ * restrictlist);
+ * add_paths_to_joinrel(root, joinrel, rel2, rel1,
+ * JOIN_RIGHT_SEMI, sjinfo,
+ * restrictlist);
+ * }
+ */
/*
* If we know how to unique-ify the RHS and one input rel is
--
2.43.0