Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
88f6d4c
feat(aggregate): cost-aware partial-aggregation skip (opt-in)
zhuqi-lucas May 26, 2026
9940d8a
[FOR BENCHMARK ONLY] flip default to true + update SLT
zhuqi-lucas May 26, 2026
2b49798
tune: drop cost_ns_per_row default from 1000 → 100
zhuqi-lucas May 26, 2026
5c10375
Merge branch 'main' into feat/adaptive-partial-agg-cost
zhuqi-lucas May 26, 2026
e6a98fe
pivot to lower-ratio Rule 2 + diagnostic gauges
zhuqi-lucas May 26, 2026
c087cb4
revert benchmark-only default flip; default back to false
zhuqi-lucas May 26, 2026
3cbcdfa
feat: A/B sampling for cost-aware partial-agg skip decision
zhuqi-lucas May 26, 2026
acb2ad9
[FOR BENCHMARK ONLY] flip default to true so bot exercises A/B sampling
zhuqi-lucas May 26, 2026
df6e264
ci: re-trigger after GitHub Actions infra outage
zhuqi-lucas May 26, 2026
44f815a
feat: segment-level re-probing for dynamic distribution shifts
zhuqi-lucas May 26, 2026
c716f33
Merge branch 'main' into feat/adaptive-partial-agg-cost
zhuqi-lucas May 26, 2026
a258afe
Revert "feat: segment-level re-probing for dynamic distribution shifts"
zhuqi-lucas May 26, 2026
a2baa6c
test: explicitly disable cost model in legacy not-locked-until-skip test
zhuqi-lucas May 26, 2026
08215ab
test: regen push_down_filter_parquet.slt for new probe gauges
zhuqi-lucas May 27, 2026
62c2580
lazy-register diagnostic gauges so small queries don't show '...=0' n…
zhuqi-lucas May 27, 2026
ffbf659
Merge branch 'main' into feat/adaptive-partial-agg-cost
zhuqi-lucas May 27, 2026
81493aa
test: disable cost model in push_down_filter_regression to stabilise …
zhuqi-lucas May 27, 2026
d1f8b7b
Merge branch 'main' into feat/adaptive-partial-agg-cost
zhuqi-lucas May 27, 2026
6f3d9c7
Merge branch 'main' into feat/adaptive-partial-agg-cost
zhuqi-lucas Jun 1, 2026
3120c71
fix: flush elapsed_compute timer before probe reads value, refresh docs
zhuqi-lucas Jun 1, 2026
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
35 changes: 35 additions & 0 deletions datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,41 @@ config_namespace! {
/// aggregation ratio check and trying to switch to skipping aggregation mode
pub skip_partial_aggregation_probe_rows_threshold: usize, default = 100_000

/// (experimental) When true, run an A/B sampling window after
/// the partial probe completes (see
/// `skip_partial_aggregation_probe_rows_threshold`): route the
/// next `skip_partial_aggregation_ab_sampling_rows` input rows
/// through the passthrough (`transform_to_states`) path,
/// measure `passthrough_ns/row`, and compare it against the
/// previously measured `partial_ns/row` plus the observed
/// `num_groups / input_rows` ratio. Skip partial aggregation
/// iff `ratio > passthrough_ns / partial_ns` — the cost
/// crossover from the closed-form comparison of
/// `keep_partial` vs `skip_partial` total work.
///
/// Targets ClickBench Q18-shape queries where the ratio
/// (~0.56) sits below the fixed 0.8 threshold so partial agg
/// keeps running, but the absolute work (heavy variable-length
/// keys, complex aggregates) makes it net-negative. The
/// existing `skip_partial_aggregation_probe_ratio_threshold`
/// short-circuit still fires before A/B when it applies.
///
/// EXPLAIN ANALYZE surfaces the measured numbers via four dev
/// gauges: `partial_agg_probe_partial_ns_per_row`,
/// `partial_agg_probe_passthrough_ns_per_row`,
/// `partial_agg_probe_ratio_per_mille`, and
/// `partial_agg_probe_cost_decision_skip`.
pub skip_partial_aggregation_use_cost_model: bool, default = true

/// Number of input rows used in the A/B sampling window after the
/// initial partial probe completes. During this window the operator
/// routes input through the passthrough (`transform_to_states`)
/// path so the probe can measure `passthrough_ns/row` and compare
/// it against the previously measured `partial_ns/row`. Default
/// 10000 — large enough to amortise per-row noise, small enough to
/// be cheap if the decision turns out to be "keep partial".
pub skip_partial_aggregation_ab_sampling_rows: usize, default = 10_000

/// Should DataFusion use row number estimates at the input to decide
/// whether increasing parallelism is beneficial or not. By default,
/// only exact row numbers (not estimates) are used for this decision.
Expand Down
Loading
Loading