Skip to content

Skip probe-to-build SIP when probe cardinality >= build cardinality - #969

Open
adsharma wants to merge 1 commit into
mainfrom
fix/skip-unprofitable-sip
Open

adsharma wants to merge 1 commit into
mainfrom
fix/skip-unprofitable-sip

Conversation

@adsharma

Copy link
Copy Markdown
Contributor

Probe-to-build SIP materializes and rescans the whole probe side (ACCUMULATE + RESULT_COLLECTOR/READ_FTABLE) 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. The LIMIT-pushdown path (probeLimit) is exempted since its capped probe still benefits from the mask.

Motivating case: CardinalityTest.TestMultiParentPackedScan dataset, where the probe-side rescan produced ~2253 single-key batches (flat-a/unflat-b factorized layout replayed one key per batch). Skipping the unprofitable SIP removes the probe-side materialization round-trip (measured ~4.3ms there) with byte-identical results.

Skipping an optimization is correctness-safe by construction. Verified locally: optimizer_test 24/24, CardinalityTest.* 7/7, join-related e2e (join/Join) 22/22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant