benchmark partition-aware dynamic filters - #3
Closed
jayshrivastava wants to merge 0 commit into
Closed
Conversation
jayshrivastava
changed the base branch from
main
to
js/benchmark-partition-aware-dynamic-filters-base-sha
July 16, 2026 17:21
jayshrivastava
force-pushed
the
js/benchmark-partition-aware-dynamic-filters
branch
from
July 17, 2026 16:33
80d2214 to
c1647e3
Compare
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.
🚨 Disclaimer
Background
For
HashJoinExec mode=Partitioned, we useCASEexpressions to achieve partition-aware dynamic filtering.This case feature was added in apache#18451, but theres' no benchmarks.
Does this necessarily perform better than something like this?
Goal
Benchmark how significantly this
CASEexpression actually improves query performance.Setup
Benchmark and Data
Benchmark: dfbench hj (query 23 and new "query 24"
Dataset: TPC-H SF1 parquet generated with tpchgen-cli v3.0.0
Profile: cargo run --profile release-nonlto
Iterations: 5
Host: Linux aarch64
Query 23 uses a partitioned hash join, so we selected it
Query 24 is a custom query which uses a stored column as the join key, allowing more effective pruning
Benchmark Cases
For all cases, force partitioned joins
CASEexpression vs globalORexpression).CASEexpressions, making the comparison a bit more fair. When pruning is not supported, we read all the row groups and apply dynamic filters on the rows after reading.datafusion.optimizer.enable_dynamic_filter_pushdown=false-
datafusion.execution.parquet.pruning=false-
datafusion.execution.parquet.enable_page_index=false-
datafusion.execution.parquet.bloom_filter_on_read=false-
datafusion.execution.parquet.pushdown_filters=truedatafusion.optimizer.enable_dynamic_filter_pushdown=true-
datafusion.optimizer.hash_join_dynamic_filter_partitioned_expr_style=case-
datafusion.execution.parquet.pruning=false-
datafusion.execution.parquet.enable_page_index=false-
datafusion.execution.parquet.bloom_filter_on_read=false-
datafusion.execution.parquet.pushdown_filters=truedatafusion.optimizer.enable_dynamic_filter_pushdown=true-
datafusion.optimizer.hash_join_dynamic_filter_partitioned_expr_style=global_or-
datafusion.execution.parquet.pruning=false-
datafusion.execution.parquet.enable_page_index=false-
datafusion.execution.parquet.bloom_filter_on_read=false-
datafusion.execution.parquet.pushdown_filters=truedatafusion.optimizer.enable_dynamic_filter_pushdown=true-
datafusion.optimizer.hash_join_dynamic_filter_partitioned_expr_style=case-
datafusion.execution.parquet.pruning=true-
datafusion.execution.parquet.enable_page_index=true-
datafusion.execution.parquet.bloom_filter_on_read=true-
datafusion.execution.parquet.pushdown_filters=truedatafusion.optimizer.enable_dynamic_filter_pushdown=true-
datafusion.optimizer.hash_join_dynamic_filter_partitioned_expr_style=global_or-
datafusion.execution.parquet.pruning=true-
datafusion.execution.parquet.enable_page_index=true-
datafusion.execution.parquet.bloom_filter_on_read=true-
datafusion.execution.parquet.pushdown_filters=trueResults
The case expression has no benefit.
Q23 Default Partitions
Q23 Four Partitions
Q24 Default Partitions
Q24 Four Partitions
Why is
CASEso slow?pushdown_rows_pruned=19.03 Kfor the global OR vs onlypushdown_rows_pruned=6.00 MforCASE. AvoidingCASEallows us to prune row groups.pushdown_eval_time=21.16msfor the global OR vspushdown_eval_time=196.13msforCASE. TheCASEexpr uses more compute.