• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: コミット

firtst release


コミットメタ情報

リビジョンd9112d928b5e3b66c52f176f8305f03ebc94cf23 (tree)
日時2017-07-27 19:20:31
作者Kyotaro Horiguchi <horiguchi.kyotaro@lab....>
コミッターKyotaro Horiguchi

ログメッセージ

Make core.c to the right version.

core.c in 9e5b1753d00cb1071eb44570d3c7f9e18823ba67 seems to be
somewhat different version. Fixed it to right version.

変更サマリ

差分

--- a/core.c
+++ b/core.c
@@ -637,26 +637,6 @@ create_plain_partial_paths(PlannerInfo *root, RelOptInfo *rel)
637637 {
638638 int parallel_workers;
639639
640- parallel_workers = compute_parallel_worker(rel, rel->pages);
641-
642- /* If any limit was set to zero, the user doesn't want a parallel scan. */
643- if (parallel_workers <= 0)
644- return;
645-
646- /* Add an unordered partial path based on a parallel sequential scan. */
647- add_partial_path(rel, create_seqscan_path(root, rel, NULL, parallel_workers));
648-}
649-
650-/*
651- * Compute the number of parallel workers that should be used to scan a
652- * relation. "pages" is the number of pages from the relation that we
653- * expect to scan.
654- */
655-static int
656-compute_parallel_worker(RelOptInfo *rel, BlockNumber pages)
657-{
658- int parallel_workers;
659-
660640 /*
661641 * If the user has set the parallel_workers reloption, use that; otherwise
662642 * select a default number of workers.
@@ -674,9 +654,9 @@ compute_parallel_worker(RelOptInfo *rel, BlockNumber pages)
674654 * might not be worthwhile just for this relation, but when combined
675655 * with all of its inheritance siblings it may well pay off.
676656 */
677- if (pages < (BlockNumber) min_parallel_relation_size &&
657+ if (rel->pages < (BlockNumber) min_parallel_relation_size &&
678658 rel->reloptkind == RELOPT_BASEREL)
679- return 0;
659+ return;
680660
681661 /*
682662 * Select the number of workers based on the log of the size of the
@@ -687,7 +667,7 @@ compute_parallel_worker(RelOptInfo *rel, BlockNumber pages)
687667 */
688668 parallel_workers = 1;
689669 parallel_threshold = Max(min_parallel_relation_size, 1);
690- while (pages >= (BlockNumber) (parallel_threshold * 3))
670+ while (rel->pages >= (BlockNumber) (parallel_threshold * 3))
691671 {
692672 parallel_workers++;
693673 parallel_threshold *= 3;
@@ -701,9 +681,13 @@ compute_parallel_worker(RelOptInfo *rel, BlockNumber pages)
701681 */
702682 parallel_workers = Min(parallel_workers, max_parallel_workers_per_gather);
703683
704- return parallel_workers;
705-}
684+ /* If any limit was set to zero, the user doesn't want a parallel scan. */
685+ if (parallel_workers <= 0)
686+ return;
706687
688+ /* Add an unordered partial path based on a parallel sequential scan. */
689+ add_partial_path(rel, create_seqscan_path(root, rel, NULL, parallel_workers));
690+}
707691
708692 /*
709693 * join_search_one_level
--- a/pg_hint_plan.c
+++ b/pg_hint_plan.c
@@ -454,7 +454,6 @@ void pg_hint_plan_set_rel_pathlist(PlannerInfo * root, RelOptInfo *rel,
454454 Index rti, RangeTblEntry *rte);
455455 static void create_plain_partial_paths(PlannerInfo *root,
456456 RelOptInfo *rel);
457-static int compute_parallel_worker(RelOptInfo *rel, BlockNumber pages);
458457
459458 static void make_rels_by_clause_joins(PlannerInfo *root, RelOptInfo *old_rel,
460459 ListCell *other_rels);
旧リポジトリブラウザで表示