OSDN Git Service

Don't leave partial paths when no parallel hint is specified
authorKyotaro Horiguchi <horikyota.ntt@gmail.com>
Fri, 14 Feb 2020 05:30:16 +0000 (14:30 +0900)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Fri, 14 Feb 2020 07:22:20 +0000 (16:22 +0900)
pg_hint_plan_set_rel_pathlist left partial paths if no parallel hint
is specified, but that behavior leaves indexscan partial paths on
restricted indexes. Remove all partial paths unconditionally.

pg_hint_plan.c

index ce5d1a2..b73e33d 100644 (file)
@@ -4557,12 +4557,8 @@ pg_hint_plan_set_rel_pathlist(PlannerInfo * root, RelOptInfo *rel,
                list_free_deep(rel->pathlist);
                rel->pathlist = NIL;
 
-               /* Remove all the partial paths if Parallel hint is specfied */
-               if ((found_hints & HINT_BM_PARALLEL) && rel->partial_pathlist)
-               {
-                       list_free_deep(rel->partial_pathlist);
-                       rel->partial_pathlist = NIL;
-               }
+               list_free_deep(rel->partial_pathlist);
+               rel->partial_pathlist = NIL;
 
                /* Regenerate paths with the current enforcement */
                set_plain_rel_pathlist(root, rel, rte);