ranges: trim interval join build payload#35
Open
mwiewior wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially addresses #33
Summary
BioIntervalcollect_matches(..., &mut Vec<u32>)RLE -> expand_probe_indicesexamples/interval_join_bench.rsto benchmark hash join vs interval join algorithms on count-heavy and wide-output overlap queriesWhy
IntervalJoinExecstill spent a disproportionate amount of time in build-side materialization on count-style overlap queries. The first PR branch concatenated the full left payload even when the join output was empty (COUNT(*)) and no residual filter needed those columns.This branch keeps the fast
take-based output path, but trims the concatenated build batch to just the columns that are actually read later. It also removes two layers of probe-side overhead that were still scalar and allocation-heavy.Benchmark
Release benchmark:
bucketed_sparse_countEXPLAIN ANALYZE,IntervalJoinExecwithAlgorithm::Coitrees:perf/issue-33-interval-join:build_time=4.124417ms,join_time=2.035374msbuild_time=3.268291ms,join_time=1.883876msRepresentative wall-clock results on the same synthetic dataset (
49,152 x 49,152rows):bucketed_sparse_count:6ms->6ms(within noise, but lower operator metrics)bucketed_sparse_wide:8ms->8ms(no regression on wide output)contig_only_sparse_count:5ms->5msThe main win is inside the operator metrics for count-style overlap joins, where the build side no longer concatenates unused left payload columns.
Validation
cargo test -p datafusion-bio-function-rangescargo run --release -p datafusion-bio-function-ranges --example interval_join_bench