Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3e4818e

Browse files
committed
Avoid unnecessary shm writes in Parallel Hash Join.
Currently, Parallel Hash Join cannot be used for full/right joins,so there is no point in setting the match flag. It turns out thatthe cache coherence traffic generated by those writes slows downlarge systems running many-core joins, so let's stop doing that.In future, if we need to use match bits in parallel joins, we mightwant to consider setting them only if not already set.Back-patch to 11, where Parallel Hash Join arrived.Reported-by: Deng, GangDiscussion:https://postgr.es/m/0F44E799048C4849BAE4B91012DB910462E9897A%40SHSMSX103.ccr.corp.intel.com
1 parent10a5252 commit3e4818e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

‎src/backend/executor/nodeHashjoin.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,26 @@ ExecHashJoinImpl(PlanState *pstate, bool parallel)
454454
if (joinqual==NULL||ExecQual(joinqual,econtext))
455455
{
456456
node->hj_MatchedOuter= true;
457-
HeapTupleHeaderSetMatch(HJTUPLE_MINTUPLE(node->hj_CurTuple));
457+
458+
if (parallel)
459+
{
460+
/*
461+
* Full/right outer joins are currently not supported
462+
* for parallel joins, so we don't need to set the
463+
* match bit. Experiments show that it's worth
464+
* avoiding the shared memory traffic on large
465+
* systems.
466+
*/
467+
Assert(!HJ_FILL_INNER(node));
468+
}
469+
else
470+
{
471+
/*
472+
* This is really only needed if HJ_FILL_INNER(node),
473+
* but we'll avoid the branch and just set it always.
474+
*/
475+
HeapTupleHeaderSetMatch(HJTUPLE_MINTUPLE(node->hj_CurTuple));
476+
}
458477

459478
/* In an antijoin, we never return a matched tuple */
460479
if (node->js.jointype==JOIN_ANTI)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp