git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c583234)
Fix failure to use clamp_row_est() for parallel joins.
2017年3月15日 16:28:54 +0000 (12:28 -0400)
2017年3月15日 16:28:54 +0000 (12:28 -0400)
Commit 0c2070cefa0e5d097b715c9a3b9b5499470019aa neglected to use
clamp_row_est() where it should have done so.

Patch by me. Report by Amit Kapila.

Discussion: http://postgr.es/m/CAA4eK1KPm8RYa1Kun3ZmQj9pb723b-EFN70j47Pid1vn3ByquA@mail.gmail.com


diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index cd6dcaab190e602da4d9ae99efabbb2076cf5237..a129d1ecb3b2f94b912e3500428b782f3123c1b4 100644 (file)
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -2147,7 +2147,12 @@ final_cost_nestloop(PlannerInfo *root, NestPath *path,
/* For partial paths, scale row estimate. */
if (path->path.parallel_workers > 0)
- path->path.rows /= get_parallel_divisor(&path->path);
+ {
+ double parallel_divisor = get_parallel_divisor(&path->path);
+
+ path->path.rows =
+ clamp_row_est(path->path.rows / parallel_divisor);
+ }
/*
* We could include disable_cost in the preliminary estimate, but that
@@ -2569,7 +2574,12 @@ final_cost_mergejoin(PlannerInfo *root, MergePath *path,
/* For partial paths, scale row estimate. */
if (path->jpath.path.parallel_workers > 0)
- path->jpath.path.rows /= get_parallel_divisor(&path->jpath.path);
+ {
+ double parallel_divisor = get_parallel_divisor(&path->jpath.path);
+
+ path->jpath.path.rows =
+ clamp_row_est(path->jpath.path.rows / parallel_divisor);
+ }
/*
* We could include disable_cost in the preliminary estimate, but that
@@ -2952,7 +2962,12 @@ final_cost_hashjoin(PlannerInfo *root, HashPath *path,
/* For partial paths, scale row estimate. */
if (path->jpath.path.parallel_workers > 0)
- path->jpath.path.rows /= get_parallel_divisor(&path->jpath.path);
+ {
+ double parallel_divisor = get_parallel_divisor(&path->jpath.path);
+
+ path->jpath.path.rows =
+ clamp_row_est(path->jpath.path.rows / parallel_divisor);
+ }
/*
* We could include disable_cost in the preliminary estimate, but that
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /