• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revisionc5a1d7df1bfa184ac68d55ff8549e41f0ca214ac (tree)
Time2020-02-20 16:45:18
AuthorKyotaro Horiguchi <horikyota.ntt@gmai...>
CommiterKyotaro Horiguchi

Log Message

Catch up core's change.

The commits 45f8eaa8e3 and 0255329a78 affected core.c. Catch up them.

Change Summary

Incremental Difference

--- a/core.c
+++ b/core.c
@@ -3,7 +3,6 @@
33 * core.c
44 * Routines copied from PostgreSQL core distribution.
55 *
6-
76 * The main purpose of this files is having access to static functions in core.
87 * Another purpose is tweaking functions behavior by replacing part of them by
98 * macro definitions. See at the end of pg_hint_plan.c for details. Anyway,
@@ -1263,6 +1262,10 @@ join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
12631262 {
12641263 SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l);
12651264
1265+ /* ignore full joins --- their ordering is predetermined */
1266+ if (sjinfo->jointype == JOIN_FULL)
1267+ continue;
1268+
12661269 if (bms_overlap(sjinfo->min_lefthand, join_plus_rhs) &&
12671270 !bms_is_subset(sjinfo->min_righthand, join_plus_rhs))
12681271 {
@@ -1270,15 +1273,6 @@ join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
12701273 sjinfo->min_righthand);
12711274 more = true;
12721275 }
1273- /* full joins constrain both sides symmetrically */
1274- if (sjinfo->jointype == JOIN_FULL &&
1275- bms_overlap(sjinfo->min_righthand, join_plus_rhs) &&
1276- !bms_is_subset(sjinfo->min_lefthand, join_plus_rhs))
1277- {
1278- join_plus_rhs = bms_add_members(join_plus_rhs,
1279- sjinfo->min_lefthand);
1280- more = true;
1281- }
12821276 }
12831277 } while (more);
12841278 if (bms_overlap(join_plus_rhs, join_lateral_rels))
@@ -1386,7 +1380,9 @@ mark_dummy_rel(RelOptInfo *rel)
13861380 rel->partial_pathlist = NIL;
13871381
13881382 /* Set up the dummy path */
1389- add_path(rel, (Path *) create_append_path(rel, NIL, NULL, 0));
1383+ add_path(rel, (Path *) create_append_path(rel, NIL,
1384+ rel->lateral_relids,
1385+ 0));
13901386
13911387 /* Set or update cheapest_total_path and related fields */
13921388 set_cheapest(rel);
Show on old repository browser