Skip to content

feat: Add selectivity-tracking wrapper for dynamic filters#20160

Open
adriangb wants to merge 14 commits intoapache:mainfrom
pydantic:dynamic-dynamic-filters
Open

feat: Add selectivity-tracking wrapper for dynamic filters#20160
adriangb wants to merge 14 commits intoapache:mainfrom
pydantic:dynamic-dynamic-filters

Conversation

@adriangb
Copy link
Contributor

@adriangb adriangb commented Feb 5, 2026

Summary

Add SelectivityAwareFilterExpr, a wrapper PhysicalExpr that tracks filter selectivity at runtime and automatically disables filters that aren't pruning enough rows. This addresses the issue where dynamic filters from HashJoinExec can be expensive to evaluate for little benefit when the build side covers most of the probe side values.

Key Features

  • Selectivity threshold: Filter disabled when rows_passed / rows_total >= threshold
  • Minimum rows: Statistics collected for min_rows before making a decision
  • Generation-aware reset: Resets when inner filter updates (e.g., hash table built)
  • Permanent disable: Once disabled, stays disabled for rest of query
  • Disabled behavior: Returns all-true array to bypass filter evaluation

New Configuration Options

Added to OptimizerOptions:

  • enable_dynamic_filter_selectivity_tracking (default: false)
  • dynamic_filter_selectivity_threshold (default: 0.95)
  • dynamic_filter_min_rows_for_selectivity (default: 10000)

Files Changed

File Changes
datafusion/physical-expr/src/expressions/selectivity_aware_filter.rs NEW - Core wrapper implementation
datafusion/physical-expr/src/expressions/mod.rs Add module and re-export
datafusion/common/src/config.rs Add 3 new config options to OptimizerOptions
datafusion/physical-plan/src/joins/hash_join/exec.rs Wrap dynamic filter with selectivity tracker
datafusion/sqllogictest/test_files/dynamic_filter_pushdown_config.slt Add integration tests

Test plan

  • Unit tests for SelectivityAwareFilterExpr (6 tests)
  • Hash join tests (367 tests pass)
  • SQL logic tests for config options
  • Verify queries return correct results with selectivity tracking enabled

🤖 Generated with Claude Code

@github-actions github-actions bot added physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt) common Related to common crate physical-plan Changes to the physical-plan crate labels Feb 5, 2026
@adriangb adriangb force-pushed the dynamic-dynamic-filters branch from 8ccef6c to 9a1ebd9 Compare February 5, 2026 11:33
Comment on lines 1118 to 1144
/// Enable selectivity-based disabling of dynamic filters from joins.
///
/// When enabled, join dynamic filters that pass most rows (above the threshold)
/// will be automatically disabled to avoid evaluation overhead. This is useful
/// when the build side of a join covers most of the probe side values, making
/// the filter expensive to evaluate for little benefit.
///
/// The selectivity tracking resets when the dynamic filter is updated (e.g., when
/// the hash table is built), allowing the filter to be re-evaluated with new data.
pub enable_dynamic_filter_selectivity_tracking: bool, default = false

/// Selectivity threshold for disabling join dynamic filters.
///
/// If the filter passes this fraction or more of rows, it will be disabled.
/// Value should be between 0.0 and 1.0.
///
/// For example, 0.95 means if 95% or more of rows pass the filter, it will be disabled.
/// Only used when `enable_dynamic_filter_selectivity_tracking` is true.
pub dynamic_filter_selectivity_threshold: f64, default = 0.95

/// Minimum number of rows to process before making a selectivity decision
/// for join dynamic filters.
///
/// The filter will remain in a tracking state until this many rows have been
/// processed. This ensures statistical stability before making the disable decision.
/// Only used when `enable_dynamic_filter_selectivity_tracking` is true.
pub dynamic_filter_min_rows_for_selectivity: usize, default = 10_000
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need all of these, or at least not sure they should be prefixed with dynamic_filter

pub struct SelectivityConfig {
/// Threshold above which the filter is disabled (e.g., 0.95 = 95% selectivity).
/// If the filter passes this fraction or more of rows, it will be disabled.
pub threshold: f64,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be in GB/s? Rows/s?

/// If the filter passes this fraction or more of rows, it will be disabled.
pub threshold: f64,
/// Minimum rows to process before making a selectivity decision.
pub min_rows: usize,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be in GB? Number of batches? Time? (or all of the above?)

@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

run benchmark tpchds tpch

@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

run benchmark tpchds tpch tpch10

@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

run benchmarks

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 5, 2026
@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

show benchmark queue

@Dandandan
Copy link
Contributor

Dandandan commented Feb 5, 2026

run benchmark tpcds

@Dandandan
Copy link
Contributor

run benchmark tpch

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (bd95912) to c92ba29 diff using: tpcds
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    73.03 ms │                72.19 ms │     no change │
│ QQuery 2  │   216.42 ms │               213.00 ms │     no change │
│ QQuery 3  │   157.55 ms │               154.02 ms │     no change │
│ QQuery 4  │  1921.19 ms │              2116.78 ms │  1.10x slower │
│ QQuery 5  │   259.22 ms │               261.63 ms │     no change │
│ QQuery 6  │  1457.05 ms │              1224.10 ms │ +1.19x faster │
│ QQuery 7  │   517.50 ms │               500.07 ms │     no change │
│ QQuery 8  │   167.00 ms │               164.80 ms │     no change │
│ QQuery 9  │   303.83 ms │               295.25 ms │     no change │
│ QQuery 10 │   174.40 ms │               169.75 ms │     no change │
│ QQuery 11 │  1286.14 ms │              1279.81 ms │     no change │
│ QQuery 12 │    67.86 ms │                66.96 ms │     no change │
│ QQuery 13 │   542.12 ms │               539.32 ms │     no change │
│ QQuery 14 │  1845.08 ms │              1901.43 ms │     no change │
│ QQuery 15 │    28.55 ms │               122.86 ms │  4.30x slower │
│ QQuery 16 │    64.94 ms │               180.33 ms │  2.78x slower │
│ QQuery 17 │   355.34 ms │               438.65 ms │  1.23x slower │
│ QQuery 18 │   192.54 ms │               387.14 ms │  2.01x slower │
│ QQuery 19 │   215.34 ms │               207.90 ms │     no change │
│ QQuery 20 │    24.59 ms │               108.44 ms │  4.41x slower │
│ QQuery 21 │    35.94 ms │               380.63 ms │ 10.59x slower │
│ QQuery 22 │   747.69 ms │               848.25 ms │  1.13x slower │
│ QQuery 23 │  1759.12 ms │              1848.79 ms │  1.05x slower │
│ QQuery 24 │   681.16 ms │               662.29 ms │     no change │
│ QQuery 25 │   517.65 ms │               515.14 ms │     no change │
│ QQuery 26 │   125.63 ms │               285.69 ms │  2.27x slower │
│ QQuery 27 │   507.48 ms │               501.38 ms │     no change │
│ QQuery 28 │   299.95 ms │               302.43 ms │     no change │
│ QQuery 29 │   445.55 ms │               439.76 ms │     no change │
│ QQuery 30 │    74.52 ms │                73.65 ms │     no change │
│ QQuery 31 │   301.40 ms │               297.91 ms │     no change │
│ QQuery 32 │    82.75 ms │               132.59 ms │  1.60x slower │
│ QQuery 33 │   207.60 ms │               202.12 ms │     no change │
│ QQuery 34 │   158.78 ms │               155.24 ms │     no change │
│ QQuery 35 │   173.36 ms │               187.88 ms │  1.08x slower │
│ QQuery 36 │   294.53 ms │               283.60 ms │     no change │
│ QQuery 37 │   259.33 ms │               258.64 ms │     no change │
│ QQuery 38 │   152.78 ms │               172.27 ms │  1.13x slower │
│ QQuery 39 │   197.20 ms │              1660.68 ms │  8.42x slower │
│ QQuery 40 │   176.28 ms │               173.94 ms │     no change │
│ QQuery 41 │    24.35 ms │                24.54 ms │     no change │
│ QQuery 42 │   144.75 ms │               142.10 ms │     no change │
│ QQuery 43 │   126.54 ms │               124.73 ms │     no change │
│ QQuery 44 │    28.47 ms │                28.65 ms │     no change │
│ QQuery 45 │    82.92 ms │                82.77 ms │     no change │
│ QQuery 46 │   317.91 ms │               318.33 ms │     no change │
│ QQuery 47 │  1026.32 ms │              1019.10 ms │     no change │
│ QQuery 48 │   395.30 ms │               398.92 ms │     no change │
│ QQuery 49 │   382.94 ms │               375.77 ms │     no change │
│ QQuery 50 │   329.82 ms │               332.32 ms │     no change │
│ QQuery 51 │   301.95 ms │               302.24 ms │     no change │
│ QQuery 52 │   144.66 ms │               143.23 ms │     no change │
│ QQuery 53 │   146.79 ms │               141.98 ms │     no change │
│ QQuery 54 │   203.08 ms │               224.04 ms │  1.10x slower │
│ QQuery 55 │   144.49 ms │               142.24 ms │     no change │
│ QQuery 56 │   206.41 ms │               203.46 ms │     no change │
│ QQuery 57 │   289.28 ms │               439.70 ms │  1.52x slower │
│ QQuery 58 │   484.32 ms │               488.51 ms │     no change │
│ QQuery 59 │   290.83 ms │               289.39 ms │     no change │
│ QQuery 60 │   210.70 ms │               206.66 ms │     no change │
│ QQuery 61 │   245.28 ms │               249.00 ms │     no change │
│ QQuery 62 │  1299.75 ms │              1268.90 ms │     no change │
│ QQuery 63 │   148.89 ms │               143.74 ms │     no change │
│ QQuery 64 │  1147.28 ms │              1146.32 ms │     no change │
│ QQuery 65 │   352.30 ms │               345.40 ms │     no change │
│ QQuery 66 │   399.04 ms │               394.30 ms │     no change │
│ QQuery 67 │   541.91 ms │               534.32 ms │     no change │
│ QQuery 68 │   375.35 ms │               372.55 ms │     no change │
│ QQuery 69 │   168.49 ms │               164.31 ms │     no change │
│ QQuery 70 │   489.95 ms │               485.54 ms │     no change │
│ QQuery 71 │   188.13 ms │               183.74 ms │     no change │
│ QQuery 72 │  2106.85 ms │             12164.89 ms │  5.77x slower │
│ QQuery 73 │   153.44 ms │               152.47 ms │     no change │
│ QQuery 74 │   817.71 ms │               802.13 ms │     no change │
│ QQuery 75 │   400.81 ms │               398.62 ms │     no change │
│ QQuery 76 │   180.07 ms │               186.19 ms │     no change │
│ QQuery 77 │   281.99 ms │               275.26 ms │     no change │
│ QQuery 78 │   685.55 ms │               672.94 ms │     no change │
│ QQuery 79 │   323.32 ms │               316.62 ms │     no change │
│ QQuery 80 │   521.98 ms │               520.43 ms │     no change │
│ QQuery 81 │    51.72 ms │                57.55 ms │  1.11x slower │
│ QQuery 82 │   283.32 ms │               276.27 ms │     no change │
│ QQuery 83 │    78.82 ms │                75.54 ms │     no change │
│ QQuery 84 │    69.50 ms │                67.74 ms │     no change │
│ QQuery 85 │   218.95 ms │               222.83 ms │     no change │
│ QQuery 86 │    58.12 ms │                56.80 ms │     no change │
│ QQuery 87 │   152.32 ms │               176.36 ms │  1.16x slower │
│ QQuery 88 │   254.96 ms │               253.77 ms │     no change │
│ QQuery 89 │   167.08 ms │               164.79 ms │     no change │
│ QQuery 90 │    44.52 ms │                44.45 ms │     no change │
│ QQuery 91 │    93.19 ms │                93.15 ms │     no change │
│ QQuery 92 │    81.02 ms │                80.08 ms │     no change │
│ QQuery 93 │   278.86 ms │               277.70 ms │     no change │
│ QQuery 94 │    90.71 ms │                87.78 ms │     no change │
│ QQuery 95 │   241.37 ms │               236.35 ms │     no change │
│ QQuery 96 │   114.00 ms │               110.34 ms │     no change │
│ QQuery 97 │   190.60 ms │               213.38 ms │  1.12x slower │
│ QQuery 98 │   217.96 ms │               211.53 ms │     no change │
│ QQuery 99 │ 13982.12 ms │             14284.22 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 49847.45ms │
│ Total Time (dynamic-dynamic-filters)   │ 62984.27ms │
│ Average Time (HEAD)                    │   503.51ms │
│ Average Time (dynamic-dynamic-filters) │   636.20ms │
│ Queries Faster                         │          1 │
│ Queries Slower                         │         20 │
│ Queries with No Change                 │         78 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (bd95912) to c92ba29 diff using: tpch
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 179.73 ms │               179.63 ms │     no change │
│ QQuery 2  │  86.42 ms │                85.23 ms │     no change │
│ QQuery 3  │ 124.40 ms │               122.71 ms │     no change │
│ QQuery 4  │  78.85 ms │                77.12 ms │     no change │
│ QQuery 5  │ 169.89 ms │               168.71 ms │     no change │
│ QQuery 6  │  65.54 ms │                67.78 ms │     no change │
│ QQuery 7  │ 205.35 ms │               211.90 ms │     no change │
│ QQuery 8  │ 160.97 ms │               162.85 ms │     no change │
│ QQuery 9  │ 224.78 ms │               216.23 ms │     no change │
│ QQuery 10 │ 180.84 ms │               178.02 ms │     no change │
│ QQuery 11 │  62.98 ms │                59.62 ms │ +1.06x faster │
│ QQuery 12 │ 117.48 ms │               117.01 ms │     no change │
│ QQuery 13 │ 219.16 ms │               221.10 ms │     no change │
│ QQuery 14 │  89.96 ms │                88.88 ms │     no change │
│ QQuery 15 │ 125.22 ms │               121.54 ms │     no change │
│ QQuery 16 │  61.87 ms │                58.97 ms │     no change │
│ QQuery 17 │ 257.79 ms │               252.09 ms │     no change │
│ QQuery 18 │ 310.85 ms │               304.87 ms │     no change │
│ QQuery 19 │ 138.14 ms │               131.65 ms │     no change │
│ QQuery 20 │ 125.64 ms │               125.06 ms │     no change │
│ QQuery 21 │ 255.07 ms │               250.18 ms │     no change │
│ QQuery 22 │  40.20 ms │                40.10 ms │     no change │
└───────────┴───────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 3281.12ms │
│ Total Time (dynamic-dynamic-filters)   │ 3241.24ms │
│ Average Time (HEAD)                    │  149.14ms │
│ Average Time (dynamic-dynamic-filters) │  147.33ms │
│ Queries Faster                         │         1 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        21 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (bd95912) to c92ba29 diff using: tpch
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 183.59 ms │               182.05 ms │ no change │
│ QQuery 2  │  86.16 ms │                86.25 ms │ no change │
│ QQuery 3  │ 123.52 ms │               123.63 ms │ no change │
│ QQuery 4  │  77.82 ms │                76.82 ms │ no change │
│ QQuery 5  │ 171.51 ms │               166.34 ms │ no change │
│ QQuery 6  │  66.28 ms │                64.86 ms │ no change │
│ QQuery 7  │ 204.87 ms │               203.42 ms │ no change │
│ QQuery 8  │ 166.10 ms │               162.66 ms │ no change │
│ QQuery 9  │ 227.99 ms │               223.17 ms │ no change │
│ QQuery 10 │ 180.73 ms │               180.58 ms │ no change │
│ QQuery 11 │  61.14 ms │                60.76 ms │ no change │
│ QQuery 12 │ 117.17 ms │               117.25 ms │ no change │
│ QQuery 13 │ 217.17 ms │               222.40 ms │ no change │
│ QQuery 14 │  91.27 ms │                88.63 ms │ no change │
│ QQuery 15 │ 123.28 ms │               122.67 ms │ no change │
│ QQuery 16 │  59.59 ms │                57.53 ms │ no change │
│ QQuery 17 │ 251.18 ms │               252.79 ms │ no change │
│ QQuery 18 │ 308.74 ms │               309.84 ms │ no change │
│ QQuery 19 │ 133.37 ms │               131.86 ms │ no change │
│ QQuery 20 │ 125.73 ms │               126.30 ms │ no change │
│ QQuery 21 │ 257.56 ms │               250.46 ms │ no change │
│ QQuery 22 │  41.77 ms │                43.60 ms │ no change │
└───────────┴───────────┴─────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 3276.53ms │
│ Total Time (dynamic-dynamic-filters)   │ 3253.83ms │
│ Average Time (HEAD)                    │  148.93ms │
│ Average Time (dynamic-dynamic-filters) │  147.90ms │
│ Queries Faster                         │         0 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        22 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

I expect benchmarks to look bad - there's overhead this wrapper introduces right now even in no-op mode. I'm going to push a fix and run benches again.

@github-actions github-actions bot added the core Core DataFusion crate label Feb 5, 2026
@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

run benchmark tpch

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (214d54d) to c92ba29 diff using: tpch
Results will be posted here when complete

@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

run benchmark tpcds

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 181.44 ms │               177.08 ms │ no change │
│ QQuery 2  │  85.46 ms │                86.28 ms │ no change │
│ QQuery 3  │ 119.33 ms │               121.16 ms │ no change │
│ QQuery 4  │  76.31 ms │                77.53 ms │ no change │
│ QQuery 5  │ 168.76 ms │               167.91 ms │ no change │
│ QQuery 6  │  66.18 ms │                65.67 ms │ no change │
│ QQuery 7  │ 204.94 ms │               207.06 ms │ no change │
│ QQuery 8  │ 166.49 ms │               165.28 ms │ no change │
│ QQuery 9  │ 222.99 ms │               220.56 ms │ no change │
│ QQuery 10 │ 181.34 ms │               181.70 ms │ no change │
│ QQuery 11 │  62.22 ms │                60.04 ms │ no change │
│ QQuery 12 │ 116.31 ms │               116.68 ms │ no change │
│ QQuery 13 │ 217.24 ms │               225.71 ms │ no change │
│ QQuery 14 │  91.51 ms │                92.05 ms │ no change │
│ QQuery 15 │ 124.54 ms │               123.26 ms │ no change │
│ QQuery 16 │  58.34 ms │                58.92 ms │ no change │
│ QQuery 17 │ 250.47 ms │               252.93 ms │ no change │
│ QQuery 18 │ 306.19 ms │               306.54 ms │ no change │
│ QQuery 19 │ 132.26 ms │               133.61 ms │ no change │
│ QQuery 20 │ 127.25 ms │               123.44 ms │ no change │
│ QQuery 21 │ 254.26 ms │               252.49 ms │ no change │
│ QQuery 22 │  40.45 ms │                39.53 ms │ no change │
└───────────┴───────────┴─────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 3254.29ms │
│ Total Time (dynamic-dynamic-filters)   │ 3255.41ms │
│ Average Time (HEAD)                    │  147.92ms │
│ Average Time (dynamic-dynamic-filters) │  147.97ms │
│ Queries Faster                         │         0 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        22 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (0835dd2) to c92ba29 diff using: tpcds
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    71.79 ms │                72.86 ms │     no change │
│ QQuery 2  │   216.81 ms │               207.13 ms │     no change │
│ QQuery 3  │   156.35 ms │               151.73 ms │     no change │
│ QQuery 4  │  1878.67 ms │              1849.63 ms │     no change │
│ QQuery 5  │   262.88 ms │               256.31 ms │     no change │
│ QQuery 6  │  1460.47 ms │              1399.43 ms │     no change │
│ QQuery 7  │   514.21 ms │               515.29 ms │     no change │
│ QQuery 8  │   170.56 ms │               165.39 ms │     no change │
│ QQuery 9  │   296.97 ms │               294.02 ms │     no change │
│ QQuery 10 │   173.24 ms │               166.89 ms │     no change │
│ QQuery 11 │  1291.34 ms │              1256.21 ms │     no change │
│ QQuery 12 │    68.76 ms │                64.58 ms │ +1.06x faster │
│ QQuery 13 │   547.00 ms │               540.21 ms │     no change │
│ QQuery 14 │  1851.00 ms │              1847.62 ms │     no change │
│ QQuery 15 │    28.17 ms │                26.28 ms │ +1.07x faster │
│ QQuery 16 │    64.63 ms │                61.65 ms │     no change │
│ QQuery 17 │   355.09 ms │               352.96 ms │     no change │
│ QQuery 18 │   191.95 ms │               189.92 ms │     no change │
│ QQuery 19 │   215.23 ms │               210.00 ms │     no change │
│ QQuery 20 │    24.23 ms │                24.29 ms │     no change │
│ QQuery 21 │    35.38 ms │                34.87 ms │     no change │
│ QQuery 22 │   752.09 ms │               734.63 ms │     no change │
│ QQuery 23 │  1742.56 ms │              1772.29 ms │     no change │
│ QQuery 24 │   685.98 ms │               678.13 ms │     no change │
│ QQuery 25 │   521.26 ms │               518.93 ms │     no change │
│ QQuery 26 │   125.14 ms │               122.95 ms │     no change │
│ QQuery 27 │   510.44 ms │               507.89 ms │     no change │
│ QQuery 28 │   298.01 ms │               298.01 ms │     no change │
│ QQuery 29 │   446.44 ms │               439.43 ms │     no change │
│ QQuery 30 │    72.94 ms │                77.04 ms │  1.06x slower │
│ QQuery 31 │   312.36 ms │               299.47 ms │     no change │
│ QQuery 32 │    80.95 ms │                79.55 ms │     no change │
│ QQuery 33 │   206.36 ms │               201.21 ms │     no change │
│ QQuery 34 │   158.15 ms │               153.93 ms │     no change │
│ QQuery 35 │   174.10 ms │               168.99 ms │     no change │
│ QQuery 36 │   287.90 ms │               281.33 ms │     no change │
│ QQuery 37 │   260.08 ms │               254.26 ms │     no change │
│ QQuery 38 │   151.90 ms │               148.18 ms │     no change │
│ QQuery 39 │   196.88 ms │               195.05 ms │     no change │
│ QQuery 40 │   176.29 ms │               178.10 ms │     no change │
│ QQuery 41 │    25.57 ms │                25.17 ms │     no change │
│ QQuery 42 │   143.99 ms │               141.85 ms │     no change │
│ QQuery 43 │   128.49 ms │               123.85 ms │     no change │
│ QQuery 44 │    28.71 ms │                27.65 ms │     no change │
│ QQuery 45 │    84.71 ms │                85.60 ms │     no change │
│ QQuery 46 │   316.62 ms │               311.19 ms │     no change │
│ QQuery 47 │  1035.67 ms │              1001.11 ms │     no change │
│ QQuery 48 │   399.39 ms │               405.25 ms │     no change │
│ QQuery 49 │   385.97 ms │               376.47 ms │     no change │
│ QQuery 50 │   326.57 ms │               329.22 ms │     no change │
│ QQuery 51 │   304.25 ms │               296.87 ms │     no change │
│ QQuery 52 │   146.03 ms │               142.18 ms │     no change │
│ QQuery 53 │   146.78 ms │               143.43 ms │     no change │
│ QQuery 54 │   202.66 ms │               198.11 ms │     no change │
│ QQuery 55 │   144.65 ms │               140.58 ms │     no change │
│ QQuery 56 │   204.22 ms │               202.49 ms │     no change │
│ QQuery 57 │   288.73 ms │               283.31 ms │     no change │
│ QQuery 58 │   487.16 ms │               504.95 ms │     no change │
│ QQuery 59 │   290.13 ms │               285.92 ms │     no change │
│ QQuery 60 │   212.18 ms │               207.90 ms │     no change │
│ QQuery 61 │   246.24 ms │               244.90 ms │     no change │
│ QQuery 62 │  1240.27 ms │              1271.68 ms │     no change │
│ QQuery 63 │   146.06 ms │               145.43 ms │     no change │
│ QQuery 64 │  1158.32 ms │              1148.40 ms │     no change │
│ QQuery 65 │   355.80 ms │               348.77 ms │     no change │
│ QQuery 66 │   379.21 ms │               399.30 ms │  1.05x slower │
│ QQuery 67 │   542.60 ms │               545.03 ms │     no change │
│ QQuery 68 │   393.16 ms │               374.32 ms │     no change │
│ QQuery 69 │   174.00 ms │               164.27 ms │ +1.06x faster │
│ QQuery 70 │   498.81 ms │               480.70 ms │     no change │
│ QQuery 71 │   187.88 ms │               184.30 ms │     no change │
│ QQuery 72 │  2115.96 ms │              2128.76 ms │     no change │
│ QQuery 73 │   155.02 ms │               150.87 ms │     no change │
│ QQuery 74 │   805.75 ms │               799.10 ms │     no change │
│ QQuery 75 │   411.25 ms │               396.53 ms │     no change │
│ QQuery 76 │   181.27 ms │               185.08 ms │     no change │
│ QQuery 77 │   277.41 ms │               275.40 ms │     no change │
│ QQuery 78 │   684.87 ms │               682.63 ms │     no change │
│ QQuery 79 │   320.64 ms │               324.13 ms │     no change │
│ QQuery 80 │   533.71 ms │               523.60 ms │     no change │
│ QQuery 81 │    53.04 ms │                53.48 ms │     no change │
│ QQuery 82 │   284.92 ms │               278.24 ms │     no change │
│ QQuery 83 │    78.52 ms │                80.41 ms │     no change │
│ QQuery 84 │    67.73 ms │                69.00 ms │     no change │
│ QQuery 85 │   210.18 ms │               224.18 ms │  1.07x slower │
│ QQuery 86 │    58.63 ms │                59.45 ms │     no change │
│ QQuery 87 │   152.10 ms │               159.22 ms │     no change │
│ QQuery 88 │   255.92 ms │               253.68 ms │     no change │
│ QQuery 89 │   166.14 ms │               166.68 ms │     no change │
│ QQuery 90 │    44.64 ms │                43.64 ms │     no change │
│ QQuery 91 │    93.76 ms │                92.61 ms │     no change │
│ QQuery 92 │    81.59 ms │                79.22 ms │     no change │
│ QQuery 93 │   282.32 ms │               285.77 ms │     no change │
│ QQuery 94 │    90.64 ms │                88.27 ms │     no change │
│ QQuery 95 │   245.03 ms │               244.09 ms │     no change │
│ QQuery 96 │   113.22 ms │               112.46 ms │     no change │
│ QQuery 97 │   188.66 ms │               191.83 ms │     no change │
│ QQuery 98 │   214.68 ms │               219.93 ms │     no change │
│ QQuery 99 │ 13988.82 ms │             14016.23 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 49815.75ms │
│ Total Time (dynamic-dynamic-filters)   │ 49521.34ms │
│ Average Time (HEAD)                    │   503.19ms │
│ Average Time (dynamic-dynamic-filters) │   500.22ms │
│ Queries Faster                         │          3 │
│ Queries Slower                         │          3 │
│ Queries with No Change                 │         93 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘

@adriangb
Copy link
Contributor Author

adriangb commented Feb 5, 2026

run benchmark tpcds

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (9a90c37) to c92ba29 diff using: tpcds
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    73.94 ms │                71.11 ms │     no change │
│ QQuery 2  │   221.38 ms │               206.92 ms │ +1.07x faster │
│ QQuery 3  │   156.47 ms │               153.44 ms │     no change │
│ QQuery 4  │  1883.91 ms │              1866.82 ms │     no change │
│ QQuery 5  │   255.67 ms │               258.62 ms │     no change │
│ QQuery 6  │  1457.72 ms │              1441.12 ms │     no change │
│ QQuery 7  │   524.45 ms │               513.67 ms │     no change │
│ QQuery 8  │   169.97 ms │               166.72 ms │     no change │
│ QQuery 9  │   307.91 ms │               289.94 ms │ +1.06x faster │
│ QQuery 10 │   171.01 ms │               172.08 ms │     no change │
│ QQuery 11 │  1288.10 ms │              1261.80 ms │     no change │
│ QQuery 12 │    66.99 ms │                67.77 ms │     no change │
│ QQuery 13 │   547.06 ms │               537.90 ms │     no change │
│ QQuery 14 │  1833.65 ms │              1836.76 ms │     no change │
│ QQuery 15 │    28.29 ms │                27.00 ms │     no change │
│ QQuery 16 │    64.66 ms │                62.37 ms │     no change │
│ QQuery 17 │   356.31 ms │               354.29 ms │     no change │
│ QQuery 18 │   194.29 ms │               185.69 ms │     no change │
│ QQuery 19 │   215.73 ms │               210.89 ms │     no change │
│ QQuery 20 │    25.73 ms │                24.20 ms │ +1.06x faster │
│ QQuery 21 │    35.70 ms │                35.58 ms │     no change │
│ QQuery 22 │   748.67 ms │               713.48 ms │     no change │
│ QQuery 23 │  1783.92 ms │              1761.40 ms │     no change │
│ QQuery 24 │   690.55 ms │               688.44 ms │     no change │
│ QQuery 25 │   526.20 ms │               518.62 ms │     no change │
│ QQuery 26 │   127.65 ms │               125.06 ms │     no change │
│ QQuery 27 │   508.12 ms │               510.89 ms │     no change │
│ QQuery 28 │   300.10 ms │               302.95 ms │     no change │
│ QQuery 29 │   449.38 ms │               440.72 ms │     no change │
│ QQuery 30 │    76.79 ms │                74.65 ms │     no change │
│ QQuery 31 │   306.34 ms │               297.01 ms │     no change │
│ QQuery 32 │    82.35 ms │                80.08 ms │     no change │
│ QQuery 33 │   206.30 ms │               202.92 ms │     no change │
│ QQuery 34 │   158.84 ms │               158.01 ms │     no change │
│ QQuery 35 │   170.27 ms │               171.52 ms │     no change │
│ QQuery 36 │   286.03 ms │               278.26 ms │     no change │
│ QQuery 37 │   260.75 ms │               257.24 ms │     no change │
│ QQuery 38 │   153.30 ms │               153.01 ms │     no change │
│ QQuery 39 │   200.55 ms │               198.61 ms │     no change │
│ QQuery 40 │   177.77 ms │               179.41 ms │     no change │
│ QQuery 41 │    25.18 ms │                25.10 ms │     no change │
│ QQuery 42 │   146.68 ms │               141.77 ms │     no change │
│ QQuery 43 │   126.82 ms │               123.50 ms │     no change │
│ QQuery 44 │    27.89 ms │                27.75 ms │     no change │
│ QQuery 45 │    86.30 ms │                83.93 ms │     no change │
│ QQuery 46 │   325.71 ms │               317.84 ms │     no change │
│ QQuery 47 │  1016.88 ms │              1012.74 ms │     no change │
│ QQuery 48 │   400.72 ms │               402.88 ms │     no change │
│ QQuery 49 │   383.60 ms │               386.92 ms │     no change │
│ QQuery 50 │   337.08 ms │               330.03 ms │     no change │
│ QQuery 51 │   304.34 ms │               301.13 ms │     no change │
│ QQuery 52 │   144.74 ms │               142.63 ms │     no change │
│ QQuery 53 │   144.55 ms │               144.89 ms │     no change │
│ QQuery 54 │   201.33 ms │               201.04 ms │     no change │
│ QQuery 55 │   145.61 ms │               144.06 ms │     no change │
│ QQuery 56 │   204.03 ms │               203.68 ms │     no change │
│ QQuery 57 │   289.90 ms │               284.65 ms │     no change │
│ QQuery 58 │   496.64 ms │               494.03 ms │     no change │
│ QQuery 59 │   290.20 ms │               284.52 ms │     no change │
│ QQuery 60 │   215.40 ms │               208.56 ms │     no change │
│ QQuery 61 │   241.77 ms │               243.37 ms │     no change │
│ QQuery 62 │  1262.03 ms │              1278.61 ms │     no change │
│ QQuery 63 │   146.90 ms │               145.95 ms │     no change │
│ QQuery 64 │  1155.11 ms │              1148.23 ms │     no change │
│ QQuery 65 │   350.34 ms │               347.62 ms │     no change │
│ QQuery 66 │   395.99 ms │               389.03 ms │     no change │
│ QQuery 67 │   542.92 ms │               524.22 ms │     no change │
│ QQuery 68 │   379.74 ms │               364.58 ms │     no change │
│ QQuery 69 │   168.61 ms │               167.07 ms │     no change │
│ QQuery 70 │   489.86 ms │               483.95 ms │     no change │
│ QQuery 71 │   185.04 ms │               184.38 ms │     no change │
│ QQuery 72 │  2122.38 ms │              2108.10 ms │     no change │
│ QQuery 73 │   152.91 ms │               152.00 ms │     no change │
│ QQuery 74 │   811.75 ms │               799.66 ms │     no change │
│ QQuery 75 │   408.95 ms │               395.93 ms │     no change │
│ QQuery 76 │   186.79 ms │               182.83 ms │     no change │
│ QQuery 77 │   279.96 ms │               276.69 ms │     no change │
│ QQuery 78 │   683.79 ms │               666.57 ms │     no change │
│ QQuery 79 │   324.33 ms │               320.00 ms │     no change │
│ QQuery 80 │   532.50 ms │               523.61 ms │     no change │
│ QQuery 81 │    52.05 ms │                49.62 ms │     no change │
│ QQuery 82 │   285.86 ms │               279.66 ms │     no change │
│ QQuery 83 │    79.41 ms │                78.98 ms │     no change │
│ QQuery 84 │    69.84 ms │                69.04 ms │     no change │
│ QQuery 85 │   210.77 ms │               218.74 ms │     no change │
│ QQuery 86 │    59.56 ms │                57.97 ms │     no change │
│ QQuery 87 │   151.34 ms │               148.56 ms │     no change │
│ QQuery 88 │   253.92 ms │               250.47 ms │     no change │
│ QQuery 89 │   167.54 ms │               165.92 ms │     no change │
│ QQuery 90 │    44.57 ms │                43.95 ms │     no change │
│ QQuery 91 │    96.06 ms │                93.14 ms │     no change │
│ QQuery 92 │    80.42 ms │                80.12 ms │     no change │
│ QQuery 93 │   287.86 ms │               279.52 ms │     no change │
│ QQuery 94 │    90.47 ms │                89.39 ms │     no change │
│ QQuery 95 │   246.42 ms │               244.70 ms │     no change │
│ QQuery 96 │   113.98 ms │               111.64 ms │     no change │
│ QQuery 97 │   193.96 ms │               188.97 ms │     no change │
│ QQuery 98 │   212.32 ms │               214.47 ms │     no change │
│ QQuery 99 │ 13980.60 ms │             14014.95 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 49905.00ms │
│ Total Time (dynamic-dynamic-filters)   │ 49500.84ms │
│ Average Time (HEAD)                    │   504.09ms │
│ Average Time (dynamic-dynamic-filters) │   500.01ms │
│ Queries Faster                         │          3 │
│ Queries Slower                         │          0 │
│ Queries with No Change                 │         96 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘

adriangb and others added 7 commits February 13, 2026 23:33
The snapshot() method was returning None, causing the wrapper to be
preserved during snapshotting. Since PruningPredicate doesn't recognize
the wrapper type, it fell back to lit(true) which disabled all row group
and file pruning.

Changed snapshot() to return the inner expression directly, stripping
the wrapper during snapshotting so pruning predicates work correctly.

Also set enable_adaptive_filter_selectivity_tracking default to false
since this is an experimental feature.

Benchmarks show no slowdowns after this fix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplifies the implementation by removing generation-aware reset logic:
- No longer tracks inner filter's generation
- snapshot_generation() returns inner's generation, or 0 when disabled
- Faster evaluate() path without generation checks

The generation tracking was unnecessary for hash join filters and added
overhead to the hot path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@adriangb adriangb force-pushed the dynamic-dynamic-filters branch from 22439b2 to 4124aae Compare February 13, 2026 23:34
… tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@adriangb
Copy link
Contributor Author

run benchmark tpcds
DATAFUSION_EXECUTION_PARQUET_PUSHDOWN_FILTERS=true
DATAFUSION_EXECUTION_PARQUET_REORDER_FILTERS=true

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (6b80e85) to 7d217b1 diff using: tpcds
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    85.69 ms │                82.02 ms │     no change │
│ QQuery 2  │   249.17 ms │               222.14 ms │ +1.12x faster │
│ QQuery 3  │   154.98 ms │               153.11 ms │     no change │
│ QQuery 4  │  1650.07 ms │              1640.11 ms │     no change │
│ QQuery 5  │   308.00 ms │               258.81 ms │ +1.19x faster │
│ QQuery 6  │   421.38 ms │               341.54 ms │ +1.23x faster │
│ QQuery 7  │   527.29 ms │               525.40 ms │     no change │
│ QQuery 8  │   241.77 ms │               191.28 ms │ +1.26x faster │
│ QQuery 9  │   874.56 ms │               854.18 ms │     no change │
│ QQuery 10 │   167.78 ms │               174.40 ms │     no change │
│ QQuery 11 │  1059.58 ms │              1034.59 ms │     no change │
│ QQuery 12 │    54.49 ms │                55.99 ms │     no change │
│ QQuery 13 │   857.59 ms │               815.89 ms │     no change │
│ QQuery 14 │  2504.87 ms │              2015.41 ms │ +1.24x faster │
│ QQuery 15 │    33.25 ms │                32.01 ms │     no change │
│ QQuery 16 │    65.87 ms │                65.27 ms │     no change │
│ QQuery 17 │   304.06 ms │               254.01 ms │ +1.20x faster │
│ QQuery 18 │   480.20 ms │               480.66 ms │     no change │
│ QQuery 19 │   190.09 ms │               188.50 ms │     no change │
│ QQuery 20 │    26.47 ms │                27.84 ms │  1.05x slower │
│ QQuery 21 │    47.52 ms │                47.70 ms │     no change │
│ QQuery 22 │   771.23 ms │               725.47 ms │ +1.06x faster │
│ QQuery 23 │  2496.35 ms │              1847.84 ms │ +1.35x faster │
│ QQuery 24 │   251.08 ms │               256.18 ms │     no change │
│ QQuery 25 │   452.80 ms │               408.52 ms │ +1.11x faster │
│ QQuery 26 │   272.39 ms │               277.37 ms │     no change │
│ QQuery 27 │   532.02 ms │               520.59 ms │     no change │
│ QQuery 28 │   471.83 ms │               514.00 ms │  1.09x slower │
│ QQuery 29 │   384.85 ms │               343.12 ms │ +1.12x faster │
│ QQuery 30 │    92.58 ms │                92.69 ms │     no change │
│ QQuery 31 │   298.92 ms │               289.02 ms │     no change │
│ QQuery 32 │    77.58 ms │                78.38 ms │     no change │
│ QQuery 33 │   198.53 ms │               193.49 ms │     no change │
│ QQuery 34 │   194.26 ms │               199.79 ms │     no change │
│ QQuery 35 │   251.81 ms │               249.91 ms │     no change │
│ QQuery 36 │   344.85 ms │               353.36 ms │     no change │
│ QQuery 37 │  1005.95 ms │               970.58 ms │     no change │
│ QQuery 38 │   183.52 ms │               177.89 ms │     no change │
│ QQuery 39 │   220.75 ms │               222.64 ms │     no change │
│ QQuery 40 │   194.66 ms │               195.82 ms │     no change │
│ QQuery 41 │    27.07 ms │                27.77 ms │     no change │
│ QQuery 42 │   147.03 ms │               144.72 ms │     no change │
│ QQuery 43 │   167.19 ms │               166.40 ms │     no change │
│ QQuery 44 │    28.97 ms │                29.22 ms │     no change │
│ QQuery 45 │    70.55 ms │                71.46 ms │     no change │
│ QQuery 46 │   324.61 ms │               316.43 ms │     no change │
│ QQuery 47 │  1230.42 ms │              1121.14 ms │ +1.10x faster │
│ QQuery 48 │   732.29 ms │               677.80 ms │ +1.08x faster │
│ QQuery 49 │   552.59 ms │               545.51 ms │     no change │
│ QQuery 50 │   750.98 ms │               695.66 ms │ +1.08x faster │
│ QQuery 51 │   355.45 ms │               369.98 ms │     no change │
│ QQuery 52 │   146.77 ms │               147.34 ms │     no change │
│ QQuery 53 │   212.87 ms │               174.59 ms │ +1.22x faster │
│ QQuery 54 │   186.30 ms │               185.48 ms │     no change │
│ QQuery 55 │   144.74 ms │               145.77 ms │     no change │
│ QQuery 56 │   190.16 ms │               194.21 ms │     no change │
│ QQuery 57 │   320.25 ms │               309.05 ms │     no change │
│ QQuery 58 │   606.34 ms │               488.52 ms │ +1.24x faster │
│ QQuery 59 │   365.60 ms │               307.62 ms │ +1.19x faster │
│ QQuery 60 │   206.15 ms │               203.47 ms │     no change │
│ QQuery 61 │   271.08 ms │               267.23 ms │     no change │
│ QQuery 62 │  1321.41 ms │              1325.55 ms │     no change │
│ QQuery 63 │   207.65 ms │               174.85 ms │ +1.19x faster │
│ QQuery 64 │ 28583.66 ms │             28523.14 ms │     no change │
│ QQuery 65 │   433.90 ms │               434.12 ms │     no change │
│ QQuery 66 │   286.12 ms │               272.72 ms │     no change │
│ QQuery 67 │   856.64 ms │               804.49 ms │ +1.06x faster │
│ QQuery 68 │   336.63 ms │               337.03 ms │     no change │
│ QQuery 69 │   169.45 ms │               170.49 ms │     no change │
│ QQuery 70 │   656.04 ms │               555.49 ms │ +1.18x faster │
│ QQuery 71 │   175.86 ms │               178.67 ms │     no change │
│ QQuery 72 │  1795.05 ms │              1703.03 ms │ +1.05x faster │
│ QQuery 73 │   177.73 ms │               167.12 ms │ +1.06x faster │
│ QQuery 74 │   750.19 ms │               733.09 ms │     no change │
│ QQuery 75 │   448.91 ms │               462.18 ms │     no change │
│ QQuery 76 │   399.50 ms │               240.28 ms │ +1.66x faster │
│ QQuery 77 │   339.58 ms │               288.67 ms │ +1.18x faster │
│ QQuery 78 │   687.88 ms │               703.69 ms │     no change │
│ QQuery 79 │   378.06 ms │               339.81 ms │ +1.11x faster │
│ QQuery 80 │   536.52 ms │               537.43 ms │     no change │
│ QQuery 81 │    59.64 ms │                56.03 ms │ +1.06x faster │
│ QQuery 82 │   257.76 ms │               259.69 ms │     no change │
│ QQuery 83 │   109.47 ms │                93.70 ms │ +1.17x faster │
│ QQuery 84 │    95.54 ms │                99.34 ms │     no change │
│ QQuery 85 │   415.17 ms │               418.36 ms │     no change │
│ QQuery 86 │    72.17 ms │                74.36 ms │     no change │
│ QQuery 87 │   183.60 ms │               188.11 ms │     no change │
│ QQuery 88 │   313.20 ms │               322.61 ms │     no change │
│ QQuery 89 │   233.69 ms │               194.99 ms │ +1.20x faster │
│ QQuery 90 │    50.31 ms │                49.25 ms │     no change │
│ QQuery 91 │   146.90 ms │               156.28 ms │  1.06x slower │
│ QQuery 92 │    73.96 ms │                76.80 ms │     no change │
│ QQuery 93 │   291.03 ms │               295.23 ms │     no change │
│ QQuery 94 │    96.82 ms │                94.56 ms │     no change │
│ QQuery 95 │   323.35 ms │               262.98 ms │ +1.23x faster │
│ QQuery 96 │   128.11 ms │               116.80 ms │ +1.10x faster │
│ QQuery 97 │   245.99 ms │               235.50 ms │     no change │
│ QQuery 98 │   162.13 ms │               158.31 ms │     no change │
│ QQuery 99 │ 14225.78 ms │             14354.97 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 82063.43ms │
│ Total Time (dynamic-dynamic-filters)   │ 79426.63ms │
│ Average Time (HEAD)                    │   828.92ms │
│ Average Time (dynamic-dynamic-filters) │   802.29ms │
│ Queries Faster                         │         29 │
│ Queries Slower                         │          3 │
│ Queries with No Change                 │         67 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘

@adriangb
Copy link
Contributor Author

run benchmark clickbench_partitioned
DATAFUSION_EXECUTION_PARQUET_PUSHDOWN_FILTERS=true
DATAFUSION_EXECUTION_PARQUET_REORDER_FILTERS=true

@adriangb
Copy link
Contributor Author

@Dandandan numbers looking pretty good here!

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (6b80e85) to 7d217b1 diff using: clickbench_partitioned
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │     2.67 ms │                 2.60 ms │     no change │
│ QQuery 1  │    52.82 ms │                54.76 ms │     no change │
│ QQuery 2  │   139.47 ms │               134.80 ms │     no change │
│ QQuery 3  │   150.76 ms │               153.93 ms │     no change │
│ QQuery 4  │  1095.03 ms │              1045.74 ms │     no change │
│ QQuery 5  │  1336.42 ms │              1251.55 ms │ +1.07x faster │
│ QQuery 6  │    16.90 ms │                18.71 ms │  1.11x slower │
│ QQuery 7  │    71.14 ms │                70.91 ms │     no change │
│ QQuery 8  │  1432.85 ms │              1411.87 ms │     no change │
│ QQuery 9  │  1808.43 ms │              1830.26 ms │     no change │
│ QQuery 10 │   482.40 ms │               484.62 ms │     no change │
│ QQuery 11 │   532.13 ms │               527.29 ms │     no change │
│ QQuery 12 │  1428.29 ms │              1394.67 ms │     no change │
│ QQuery 13 │  2073.17 ms │              2095.31 ms │     no change │
│ QQuery 14 │  1424.87 ms │              1415.96 ms │     no change │
│ QQuery 15 │  1220.43 ms │              1201.90 ms │     no change │
│ QQuery 16 │  2555.10 ms │              2476.60 ms │     no change │
│ QQuery 17 │  2548.77 ms │              2457.11 ms │     no change │
│ QQuery 18 │  4822.58 ms │              4990.47 ms │     no change │
│ QQuery 19 │   139.57 ms │               141.92 ms │     no change │
│ QQuery 20 │  1856.36 ms │              1873.17 ms │     no change │
│ QQuery 21 │  2328.75 ms │              2315.48 ms │     no change │
│ QQuery 22 │  4019.35 ms │              3962.20 ms │     no change │
│ QQuery 23 │  1113.63 ms │              1066.36 ms │     no change │
│ QQuery 24 │   252.80 ms │               235.38 ms │ +1.07x faster │
│ QQuery 25 │   646.85 ms │               627.24 ms │     no change │
│ QQuery 26 │   345.06 ms │               341.83 ms │     no change │
│ QQuery 27 │  2978.75 ms │              2921.99 ms │     no change │
│ QQuery 28 │ 24986.39 ms │             22252.33 ms │ +1.12x faster │
│ QQuery 29 │   945.32 ms │               948.70 ms │     no change │
│ QQuery 30 │  1315.90 ms │              1296.59 ms │     no change │
│ QQuery 31 │  1363.44 ms │              1340.15 ms │     no change │
│ QQuery 32 │  3966.35 ms │              4485.00 ms │  1.13x slower │
│ QQuery 33 │  5172.24 ms │              5724.71 ms │  1.11x slower │
│ QQuery 34 │  5650.50 ms │              5698.06 ms │     no change │
│ QQuery 35 │  1891.09 ms │              1840.89 ms │     no change │
│ QQuery 36 │   180.74 ms │               175.47 ms │     no change │
│ QQuery 37 │    90.54 ms │                91.29 ms │     no change │
│ QQuery 38 │    91.51 ms │                90.31 ms │     no change │
│ QQuery 39 │   304.83 ms │               295.45 ms │     no change │
│ QQuery 40 │    58.05 ms │                58.62 ms │     no change │
│ QQuery 41 │    50.72 ms │                50.52 ms │     no change │
│ QQuery 42 │    36.96 ms │                38.31 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 82979.94ms │
│ Total Time (dynamic-dynamic-filters)   │ 80891.03ms │
│ Average Time (HEAD)                    │  1929.77ms │
│ Average Time (dynamic-dynamic-filters) │  1881.19ms │
│ Queries Faster                         │          3 │
│ Queries Slower                         │          3 │
│ Queries with No Change                 │         37 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘

@Dandandan
Copy link
Contributor

run benchmarks

@Dandandan
Copy link
Contributor

run benchmarks
DATAFUSION_EXECUTION_PARQUET_PUSHDOWN_FILTERS=true
DATAFUSION_EXECUTION_PARQUET_REORDER_FILTERS=true

@Dandandan
Copy link
Contributor

run benchmark tpch
DATAFUSION_EXECUTION_PARQUET_PUSHDOWN_FILTERS=true
DATAFUSION_EXECUTION_PARQUET_REORDER_FILTERS=true

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (6b80e85) to 7d217b1 diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query    ┃        HEAD ┃ dynamic-dynamic-filters ┃       Change ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0 │  2319.91 ms │              2266.04 ms │    no change │
│ QQuery 1 │   909.83 ms │               941.73 ms │    no change │
│ QQuery 2 │  1825.57 ms │              1832.62 ms │    no change │
│ QQuery 3 │  1065.79 ms │              1049.66 ms │    no change │
│ QQuery 4 │  2172.21 ms │              2147.47 ms │    no change │
│ QQuery 5 │ 28486.93 ms │             28532.89 ms │    no change │
│ QQuery 6 │  3869.11 ms │              3839.34 ms │    no change │
│ QQuery 7 │  2498.59 ms │              2691.88 ms │ 1.08x slower │
└──────────┴─────────────┴─────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 43147.95ms │
│ Total Time (dynamic-dynamic-filters)   │ 43301.63ms │
│ Average Time (HEAD)                    │  5393.49ms │
│ Average Time (dynamic-dynamic-filters) │  5412.70ms │
│ Queries Faster                         │          0 │
│ Queries Slower                         │          1 │
│ Queries with No Change                 │          7 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │     2.69 ms │                 2.68 ms │     no change │
│ QQuery 1  │    51.04 ms │                50.35 ms │     no change │
│ QQuery 2  │   132.51 ms │               138.59 ms │     no change │
│ QQuery 3  │   155.42 ms │               156.72 ms │     no change │
│ QQuery 4  │  1062.37 ms │              1050.79 ms │     no change │
│ QQuery 5  │  1317.23 ms │              1273.76 ms │     no change │
│ QQuery 6  │     6.52 ms │                 7.37 ms │  1.13x slower │
│ QQuery 7  │    55.76 ms │                56.52 ms │     no change │
│ QQuery 8  │  1417.82 ms │              1410.99 ms │     no change │
│ QQuery 9  │  1805.78 ms │              1745.79 ms │     no change │
│ QQuery 10 │   342.04 ms │               354.76 ms │     no change │
│ QQuery 11 │   400.38 ms │               405.22 ms │     no change │
│ QQuery 12 │  1248.00 ms │              1228.55 ms │     no change │
│ QQuery 13 │  1951.63 ms │              1883.18 ms │     no change │
│ QQuery 14 │  1273.02 ms │              1219.80 ms │     no change │
│ QQuery 15 │  1167.93 ms │              1200.64 ms │     no change │
│ QQuery 16 │  2528.40 ms │              2484.32 ms │     no change │
│ QQuery 17 │  2493.98 ms │              2469.47 ms │     no change │
│ QQuery 18 │  4772.26 ms │              4685.91 ms │     no change │
│ QQuery 19 │   121.34 ms │               121.07 ms │     no change │
│ QQuery 20 │  1891.21 ms │              1885.37 ms │     no change │
│ QQuery 21 │  2224.21 ms │              2166.49 ms │     no change │
│ QQuery 22 │  3790.93 ms │              3668.75 ms │     no change │
│ QQuery 23 │ 12308.05 ms │             12051.88 ms │     no change │
│ QQuery 24 │   208.13 ms │               211.40 ms │     no change │
│ QQuery 25 │   478.79 ms │               446.01 ms │ +1.07x faster │
│ QQuery 26 │   206.15 ms │               203.48 ms │     no change │
│ QQuery 27 │  2698.06 ms │              2621.15 ms │     no change │
│ QQuery 28 │ 24317.58 ms │             21590.02 ms │ +1.13x faster │
│ QQuery 29 │   963.72 ms │               979.53 ms │     no change │
│ QQuery 30 │  1271.71 ms │              1238.31 ms │     no change │
│ QQuery 31 │  1384.12 ms │              1287.83 ms │ +1.07x faster │
│ QQuery 32 │  4153.09 ms │              3911.84 ms │ +1.06x faster │
│ QQuery 33 │  5317.23 ms │              5318.61 ms │     no change │
│ QQuery 34 │  6035.12 ms │              5586.14 ms │ +1.08x faster │
│ QQuery 35 │  1924.51 ms │              1853.20 ms │     no change │
│ QQuery 36 │   193.17 ms │               188.44 ms │     no change │
│ QQuery 37 │    75.29 ms │                75.97 ms │     no change │
│ QQuery 38 │   117.46 ms │               114.99 ms │     no change │
│ QQuery 39 │   360.53 ms │               352.23 ms │     no change │
│ QQuery 40 │    41.48 ms │                39.75 ms │     no change │
│ QQuery 41 │    35.30 ms │                34.72 ms │     no change │
│ QQuery 42 │    31.15 ms │                30.84 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 92333.13ms │
│ Total Time (dynamic-dynamic-filters)   │ 87803.43ms │
│ Average Time (HEAD)                    │  2147.28ms │
│ Average Time (dynamic-dynamic-filters) │  2041.94ms │
│ Queries Faster                         │          5 │
│ Queries Slower                         │          1 │
│ Queries with No Change                 │         37 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 103.78 ms │               102.21 ms │     no change │
│ QQuery 2  │  32.22 ms │                32.97 ms │     no change │
│ QQuery 3  │  37.00 ms │                40.89 ms │  1.11x slower │
│ QQuery 4  │  31.94 ms │                31.24 ms │     no change │
│ QQuery 5  │  93.09 ms │                90.91 ms │     no change │
│ QQuery 6  │  20.92 ms │                20.97 ms │     no change │
│ QQuery 7  │ 162.57 ms │               163.76 ms │     no change │
│ QQuery 8  │  41.97 ms │                40.62 ms │     no change │
│ QQuery 9  │ 111.79 ms │               107.75 ms │     no change │
│ QQuery 10 │  68.81 ms │                68.61 ms │     no change │
│ QQuery 11 │  19.02 ms │                19.35 ms │     no change │
│ QQuery 12 │  52.25 ms │                50.87 ms │     no change │
│ QQuery 13 │  51.31 ms │                49.63 ms │     no change │
│ QQuery 14 │  15.66 ms │                15.06 ms │     no change │
│ QQuery 15 │  31.17 ms │                30.68 ms │     no change │
│ QQuery 16 │  30.14 ms │                28.20 ms │ +1.07x faster │
│ QQuery 17 │ 151.97 ms │               147.01 ms │     no change │
│ QQuery 18 │ 285.71 ms │               285.93 ms │     no change │
│ QQuery 19 │  41.96 ms │                40.63 ms │     no change │
│ QQuery 20 │  56.30 ms │                59.21 ms │  1.05x slower │
│ QQuery 21 │ 184.18 ms │               188.61 ms │     no change │
│ QQuery 22 │  23.20 ms │                23.46 ms │     no change │
└───────────┴───────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 1646.98ms │
│ Total Time (dynamic-dynamic-filters)   │ 1638.58ms │
│ Average Time (HEAD)                    │   74.86ms │
│ Average Time (dynamic-dynamic-filters) │   74.48ms │
│ Queries Faster                         │         1 │
│ Queries Slower                         │         2 │
│ Queries with No Change                 │        19 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (6b80e85) to 7d217b1 diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query    ┃        HEAD ┃ dynamic-dynamic-filters ┃    Change ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 0 │  2333.88 ms │              2282.15 ms │ no change │
│ QQuery 1 │   902.72 ms │               901.98 ms │ no change │
│ QQuery 2 │  1770.23 ms │              1837.92 ms │ no change │
│ QQuery 3 │  1026.75 ms │              1035.71 ms │ no change │
│ QQuery 4 │  2236.95 ms │              2218.72 ms │ no change │
│ QQuery 5 │ 28820.03 ms │             28276.07 ms │ no change │
│ QQuery 6 │   106.63 ms │               108.90 ms │ no change │
│ QQuery 7 │  2607.37 ms │              2589.24 ms │ no change │
└──────────┴─────────────┴─────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 39804.56ms │
│ Total Time (dynamic-dynamic-filters)   │ 39250.68ms │
│ Average Time (HEAD)                    │  4975.57ms │
│ Average Time (dynamic-dynamic-filters) │  4906.33ms │
│ Queries Faster                         │          0 │
│ Queries Slower                         │          0 │
│ Queries with No Change                 │          8 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │     2.81 ms │                 2.73 ms │     no change │
│ QQuery 1  │    53.31 ms │                53.74 ms │     no change │
│ QQuery 2  │   135.72 ms │               136.45 ms │     no change │
│ QQuery 3  │   153.92 ms │               158.02 ms │     no change │
│ QQuery 4  │  1029.46 ms │              1041.85 ms │     no change │
│ QQuery 5  │  1281.12 ms │              1317.28 ms │     no change │
│ QQuery 6  │    18.04 ms │                18.68 ms │     no change │
│ QQuery 7  │    66.99 ms │                69.21 ms │     no change │
│ QQuery 8  │  1392.35 ms │              1411.79 ms │     no change │
│ QQuery 9  │  1765.44 ms │              1855.18 ms │  1.05x slower │
│ QQuery 10 │   463.48 ms │               493.12 ms │  1.06x slower │
│ QQuery 11 │   518.06 ms │               532.45 ms │     no change │
│ QQuery 12 │  1395.31 ms │              1411.39 ms │     no change │
│ QQuery 13 │  2032.24 ms │              2064.42 ms │     no change │
│ QQuery 14 │  1393.44 ms │              1424.02 ms │     no change │
│ QQuery 15 │  1149.14 ms │              1190.38 ms │     no change │
│ QQuery 16 │  2496.69 ms │              2425.39 ms │     no change │
│ QQuery 17 │  2466.44 ms │              2422.12 ms │     no change │
│ QQuery 18 │  5236.18 ms │              4891.87 ms │ +1.07x faster │
│ QQuery 19 │   139.14 ms │               143.88 ms │     no change │
│ QQuery 20 │  1934.65 ms │              1894.61 ms │     no change │
│ QQuery 21 │  2373.05 ms │              2290.86 ms │     no change │
│ QQuery 22 │  4024.68 ms │              3934.15 ms │     no change │
│ QQuery 23 │  1117.58 ms │              1077.16 ms │     no change │
│ QQuery 24 │   260.22 ms │               249.19 ms │     no change │
│ QQuery 25 │   643.51 ms │               622.44 ms │     no change │
│ QQuery 26 │   349.97 ms │               341.18 ms │     no change │
│ QQuery 27 │  3022.65 ms │              2982.49 ms │     no change │
│ QQuery 28 │ 25368.11 ms │             22303.63 ms │ +1.14x faster │
│ QQuery 29 │   980.85 ms │               980.14 ms │     no change │
│ QQuery 30 │  1279.17 ms │              1277.87 ms │     no change │
│ QQuery 31 │  1344.29 ms │              1355.01 ms │     no change │
│ QQuery 32 │  4438.48 ms │              4094.77 ms │ +1.08x faster │
│ QQuery 33 │  5575.74 ms │              5178.24 ms │ +1.08x faster │
│ QQuery 34 │  6252.24 ms │              5849.34 ms │ +1.07x faster │
│ QQuery 35 │  1839.81 ms │              1851.88 ms │     no change │
│ QQuery 36 │   186.39 ms │               184.70 ms │     no change │
│ QQuery 37 │    89.73 ms │                88.12 ms │     no change │
│ QQuery 38 │    93.20 ms │                92.75 ms │     no change │
│ QQuery 39 │   300.01 ms │               284.27 ms │ +1.06x faster │
│ QQuery 40 │    58.23 ms │                59.23 ms │     no change │
│ QQuery 41 │    49.87 ms │                53.65 ms │  1.08x slower │
│ QQuery 42 │    36.78 ms │                37.67 ms │     no change │
└───────────┴─────────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 84808.48ms │
│ Total Time (dynamic-dynamic-filters)   │ 80147.33ms │
│ Average Time (HEAD)                    │  1972.29ms │
│ Average Time (dynamic-dynamic-filters) │  1863.89ms │
│ Queries Faster                         │          6 │
│ Queries Slower                         │          3 │
│ Queries with No Change                 │         34 │
│ Queries with Failure                   │          0 │
└────────────────────────────────────────┴────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 103.47 ms │               101.84 ms │ no change │
│ QQuery 2  │  33.58 ms │                32.84 ms │ no change │
│ QQuery 3  │  39.80 ms │                39.73 ms │ no change │
│ QQuery 4  │  31.84 ms │                31.82 ms │ no change │
│ QQuery 5  │  91.71 ms │                90.88 ms │ no change │
│ QQuery 6  │  21.09 ms │                21.15 ms │ no change │
│ QQuery 7  │ 159.68 ms │               165.75 ms │ no change │
│ QQuery 8  │  41.72 ms │                41.91 ms │ no change │
│ QQuery 9  │ 109.28 ms │               106.15 ms │ no change │
│ QQuery 10 │  70.65 ms │                69.11 ms │ no change │
│ QQuery 11 │  20.04 ms │                19.32 ms │ no change │
│ QQuery 12 │  53.45 ms │                53.62 ms │ no change │
│ QQuery 13 │  53.89 ms │                53.70 ms │ no change │
│ QQuery 14 │  15.93 ms │                16.00 ms │ no change │
│ QQuery 15 │  31.91 ms │                32.15 ms │ no change │
│ QQuery 16 │  29.97 ms │                28.93 ms │ no change │
│ QQuery 17 │ 147.97 ms │               147.69 ms │ no change │
│ QQuery 18 │ 286.83 ms │               287.86 ms │ no change │
│ QQuery 19 │  41.30 ms │                41.96 ms │ no change │
│ QQuery 20 │  56.60 ms │                55.95 ms │ no change │
│ QQuery 21 │ 195.23 ms │               195.45 ms │ no change │
│ QQuery 22 │  23.31 ms │                23.10 ms │ no change │
└───────────┴───────────┴─────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 1659.26ms │
│ Total Time (dynamic-dynamic-filters)   │ 1656.90ms │
│ Average Time (HEAD)                    │   75.42ms │
│ Average Time (dynamic-dynamic-filters) │   75.31ms │
│ Queries Faster                         │         0 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        22 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing dynamic-dynamic-filters (6b80e85) to 7d217b1 diff using: tpch
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 190.43 ms │               187.12 ms │     no change │
│ QQuery 2  │  99.64 ms │               101.74 ms │     no change │
│ QQuery 3  │ 177.58 ms │               177.63 ms │     no change │
│ QQuery 4  │ 139.07 ms │               139.99 ms │     no change │
│ QQuery 5  │ 305.90 ms │               295.46 ms │     no change │
│ QQuery 6  │ 206.58 ms │               199.63 ms │     no change │
│ QQuery 7  │ 276.96 ms │               270.85 ms │     no change │
│ QQuery 8  │ 323.63 ms │               325.31 ms │     no change │
│ QQuery 9  │ 428.27 ms │               328.44 ms │ +1.30x faster │
│ QQuery 10 │ 279.12 ms │               281.80 ms │     no change │
│ QQuery 11 │  80.22 ms │                78.44 ms │     no change │
│ QQuery 12 │ 259.66 ms │               268.57 ms │     no change │
│ QQuery 13 │ 217.43 ms │               213.38 ms │     no change │
│ QQuery 14 │ 110.72 ms │               107.96 ms │     no change │
│ QQuery 15 │ 197.84 ms │               198.16 ms │     no change │
│ QQuery 16 │  77.90 ms │                78.08 ms │     no change │
│ QQuery 17 │ 225.25 ms │               227.57 ms │     no change │
│ QQuery 18 │ 497.24 ms │               332.51 ms │ +1.50x faster │
│ QQuery 19 │ 153.84 ms │               154.09 ms │     no change │
│ QQuery 20 │ 158.26 ms │               158.02 ms │     no change │
│ QQuery 21 │ 357.71 ms │               362.74 ms │     no change │
│ QQuery 22 │  65.88 ms │                63.47 ms │     no change │
└───────────┴───────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 4829.13ms │
│ Total Time (dynamic-dynamic-filters)   │ 4550.95ms │
│ Average Time (HEAD)                    │  219.51ms │
│ Average Time (dynamic-dynamic-filters) │  206.86ms │
│ Queries Faster                         │         2 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        20 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

@Dandandan
Copy link
Contributor

Dandandan commented Feb 14, 2026

🤖: Benchmark completed

Details

Comparing HEAD and dynamic-dynamic-filters
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ dynamic-dynamic-filters ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 190.43 ms │               187.12 ms │     no change │
│ QQuery 2  │  99.64 ms │               101.74 ms │     no change │
│ QQuery 3  │ 177.58 ms │               177.63 ms │     no change │
│ QQuery 4  │ 139.07 ms │               139.99 ms │     no change │
│ QQuery 5  │ 305.90 ms │               295.46 ms │     no change │
│ QQuery 6  │ 206.58 ms │               199.63 ms │     no change │
│ QQuery 7  │ 276.96 ms │               270.85 ms │     no change │
│ QQuery 8  │ 323.63 ms │               325.31 ms │     no change │
│ QQuery 9  │ 428.27 ms │               328.44 ms │ +1.30x faster │
│ QQuery 10 │ 279.12 ms │               281.80 ms │     no change │
│ QQuery 11 │  80.22 ms │                78.44 ms │     no change │
│ QQuery 12 │ 259.66 ms │               268.57 ms │     no change │
│ QQuery 13 │ 217.43 ms │               213.38 ms │     no change │
│ QQuery 14 │ 110.72 ms │               107.96 ms │     no change │
│ QQuery 15 │ 197.84 ms │               198.16 ms │     no change │
│ QQuery 16 │  77.90 ms │                78.08 ms │     no change │
│ QQuery 17 │ 225.25 ms │               227.57 ms │     no change │
│ QQuery 18 │ 497.24 ms │               332.51 ms │ +1.50x faster │
│ QQuery 19 │ 153.84 ms │               154.09 ms │     no change │
│ QQuery 20 │ 158.26 ms │               158.02 ms │     no change │
│ QQuery 21 │ 357.71 ms │               362.74 ms │     no change │
│ QQuery 22 │  65.88 ms │                63.47 ms │     no change │
└───────────┴───────────┴─────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                      ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                      │ 4829.13ms │
│ Total Time (dynamic-dynamic-filters)   │ 4550.95ms │
│ Average Time (HEAD)                    │  219.51ms │
│ Average Time (dynamic-dynamic-filters) │  206.86ms │
│ Queries Faster                         │         2 │
│ Queries Slower                         │         0 │
│ Queries with No Change                 │        20 │
│ Queries with Failure                   │         0 │
└────────────────────────────────────────┴───────────┘

So an improvement for 2 queries, but still most queries are slower than without pushdown.

@adriangb
Copy link
Contributor Author

#20160 (comment)

This is the main improvement.

@Dandandan
Copy link
Contributor

Dandandan commented Feb 15, 2026

#20160 (comment)

This is the main improvement.

Ok - yes I see some improvements here and there but it is still largely regressing main with ~30s (TPCDS runs in ~50s without and ~80s with filter pushdown). See e.g. this run #20318 (comment) against main without dynamic filter pushdown.

│ QQuery 64 │  1194.15 ms │                 31181.42 ms │ 26.11x slower │

This ~26x regression (and many others) is still unchanged in this PR:

│ QQuery 64 │ 28583.66 ms │             28523.14 ms │     no change │

As we're running with DATAFUSION_EXECUTION_PARQUET_PUSHDOWN_FILTERS=true DATAFUSION_EXECUTION_PARQUET_REORDER_FILTERS=true also the main branch is showing the regressions - so we're comparing both "slow" versions.

I think I now have an understanding why the current approaches adaptiveness isn't helping that much yet.
As we're only checking the filters on open it is only sorted / considered / discarded when the query consists of many files i.e. more files than threads. In other cases, it will evaluate / scan the columns regardless of the tracking (as it will open the files directly at the start of the query / query phase when the selectivity is yet unknown).

I think for it to work effectively, it needs to integrate more with the parquet reader to remove or add a filter based on the adaptiveness during the scan.

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

Labels

common Related to common crate core Core DataFusion crate documentation Improvements or additions to documentation physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants