Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/optimizer/acc_hash_join_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,16 @@ static bool tryProbeToBuildHJSIP(LogicalOperator* op,
if (!isProbeSideQualified(op->getChild(0).get())) {
return false;
}
// Probe-to-build SIP materializes and rescans the whole probe side (ACCUMULATE +
// READ_FTABLE, one morsel per factorized-table row) to seed the build-side semi mask.
// When the probe side is at least as large as the build side, the mask can prune at most
// buildCard rows while materialization pays collect + rescan over probeCard rows, so the
// optimization cannot pay off: keep the plain pipelined hash join. Exempt the LIMIT
// pushdown path (probeLimit), whose capped probe still benefits from the mask.
if (probeLimit == nullptr &&
hashJoin.getChild(0)->getCardinality() >= hashJoin.getChild(1)->getCardinality()) {
return false;
}
auto probeRoot = hashJoin.getChild(0);
auto buildRoot = hashJoin.getChild(1);
auto hasSemiMaskApplied = false;
Expand Down
Loading