• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revisionb09afeddfd299b016fbf36df55374e408db806e0 (tree)
Time2020-02-20 18:58:34
AuthorKyotaro Horiguchi <horikyota.ntt@gmai...>
CommiterKyotaro Horiguchi

Log Message

Catch up core's change.

The commits 19ff710aaa, 19ff710aaa and d4b754c876 affected
core.c. Catch up them.

Change Summary

Incremental Difference

--- a/core.c
+++ b/core.c
@@ -336,7 +336,7 @@ add_paths_to_append_rel(PlannerInfo *root, RelOptInfo *rel,
336336 /*
337337 * Consider an append of partial unordered, unparameterized partial paths.
338338 */
339- if (partial_subpaths_valid)
339+ if (partial_subpaths_valid && partial_subpaths != NIL)
340340 {
341341 AppendPath *appendpath;
342342 ListCell *lc;
@@ -1313,6 +1313,10 @@ join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
13131313 {
13141314 SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l);
13151315
1316+ /* ignore full joins --- their ordering is predetermined */
1317+ if (sjinfo->jointype == JOIN_FULL)
1318+ continue;
1319+
13161320 if (bms_overlap(sjinfo->min_lefthand, join_plus_rhs) &&
13171321 !bms_is_subset(sjinfo->min_righthand, join_plus_rhs))
13181322 {
@@ -1320,15 +1324,6 @@ join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
13201324 sjinfo->min_righthand);
13211325 more = true;
13221326 }
1323- /* full joins constrain both sides symmetrically */
1324- if (sjinfo->jointype == JOIN_FULL &&
1325- bms_overlap(sjinfo->min_righthand, join_plus_rhs) &&
1326- !bms_is_subset(sjinfo->min_lefthand, join_plus_rhs))
1327- {
1328- join_plus_rhs = bms_add_members(join_plus_rhs,
1329- sjinfo->min_lefthand);
1330- more = true;
1331- }
13321327 }
13331328 } while (more);
13341329 if (bms_overlap(join_plus_rhs, join_lateral_rels))
@@ -1429,7 +1424,9 @@ mark_dummy_rel(RelOptInfo *rel)
14291424 rel->partial_pathlist = NIL;
14301425
14311426 /* Set up the dummy path */
1432- add_path(rel, (Path *) create_append_path(rel, NIL, NULL, 0, NIL));
1427+ add_path(rel, (Path *) create_append_path(rel, NIL,
1428+ rel->lateral_relids,
1429+ 0, NIL));
14331430
14341431 /* Set or update cheapest_total_path and related fields */
14351432 set_cheapest(rel);
Show on old repository browser