Commit 5b804cc1 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix costing of parallel hash joins.

Commit 18042840 established that single-batch
parallel-aware hash joins could create one large shared hash table using the
combined work_mem budget of all participants.  The costing accidentally
assumed that parallel-oblivious hash joins could also do that.  The
documentation for initial_cost_hashjoin() also failed to mention the new
argument.  Repair.

Author: Thomas Munro
Reported-By: Antonin Houska
Reviewed-By: Antonin Houska
Discussion: https://postgr.es/m/12441.1513935950%40localhost
parent a3739e37
...@@ -3143,6 +3143,8 @@ cached_scansel(PlannerInfo *root, RestrictInfo *rinfo, PathKey *pathkey) ...@@ -3143,6 +3143,8 @@ cached_scansel(PlannerInfo *root, RestrictInfo *rinfo, PathKey *pathkey)
* 'outer_path' is the outer input to the join * 'outer_path' is the outer input to the join
* 'inner_path' is the inner input to the join * 'inner_path' is the inner input to the join
* 'extra' contains miscellaneous information about the join * 'extra' contains miscellaneous information about the join
* 'parallel_hash' indicates that inner_path is partial and that a shared
* hash table will be built in parallel
*/ */
void void
initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace, initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace,
......
...@@ -814,7 +814,7 @@ try_partial_hashjoin_path(PlannerInfo *root, ...@@ -814,7 +814,7 @@ try_partial_hashjoin_path(PlannerInfo *root,
* cost. Bail out right away if it looks terrible. * cost. Bail out right away if it looks terrible.
*/ */
initial_cost_hashjoin(root, &workspace, jointype, hashclauses, initial_cost_hashjoin(root, &workspace, jointype, hashclauses,
outer_path, inner_path, extra, true); outer_path, inner_path, extra, parallel_hash);
if (!add_partial_path_precheck(joinrel, workspace.total_cost, NIL)) if (!add_partial_path_precheck(joinrel, workspace.total_cost, NIL))
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment