Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b804cc

Browse filesBrowse 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
Copy full SHA for 5b804cc

File tree

Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed

‎src/backend/optimizer/path/costsize.c

Copy file name to clipboardExpand all lines: src/backend/optimizer/path/costsize.c
+2Lines changed: 2 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: src/backend/optimizer/path/joinpath.c
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.