Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5b804cc

Browse files
committed
Fix costing of parallel hash joins.
Commit 1804284 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
1 parent a3739e3 commit 5b804cc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/backend/optimizer/path/costsize.c

+2
Original file line numberDiff line numberDiff line change
@@ -3143,6 +3143,8 @@ cached_scansel(PlannerInfo *root, RestrictInfo *rinfo, PathKey *pathkey)
31433143
* 'outer_path' is the outer input to the join
31443144
* 'inner_path' is the inner input to the join
31453145
* 'extra' contains miscellaneous information about the join
3146+
* 'parallel_hash' indicates that inner_path is partial and that a shared
3147+
* hash table will be built in parallel
31463148
*/
31473149
void
31483150
initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace,

src/backend/optimizer/path/joinpath.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ try_partial_hashjoin_path(PlannerInfo *root,
814814
* cost. Bail out right away if it looks terrible.
815815
*/
816816
initial_cost_hashjoin(root, &workspace, jointype, hashclauses,
817-
outer_path, inner_path, extra, true);
817+
outer_path, inner_path, extra, parallel_hash);
818818
if (!add_partial_path_precheck(joinrel, workspace.total_cost, NIL))
819819
return;
820820

0 commit comments

Comments
 (0)