Skip to content

refactor: Simplify LimitedDistinctAggregation optimizer rule, push limit in more cases - #26069

Merged
alamb merged 4 commits into
apache:mainfrom
2010YOUY01:cleanup-limit-aggr
Oct 8, 2026
Merged

alamb merged 4 commits into
apache:mainfrom
2010YOUY01:cleanup-limit-aggr

Conversation

@2010YOUY01

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

This is primarily a simplifying refactor, with an optimizer regression fix piggy-backed on top (an inefficient plan shape, not a correctness issue):

The optimizer fix itself is only a one-line change. If this simplification is not desirable, I'll open a replacement PR containing just the direct fix.

Rationale for this change

Part 1: Optimizer fix

See sqllogictest diff for the reproducer
I'll mark the fix in comments

Part 2: Optimizer simplification

During different stages in physical optimization, a logical aggregation can be either

AggregateExec(mode=final)
--AggregateExec(mode=partial)

AggregateExec(mode=single)

AggregateExec(mode=final)
--RepartitionExec
----AggregateExec(mode=partial)

So the existing implementation is using a nested dfs (the closure has another dfs inside, to match non-consecutive aggregates) try to match all of the 3 cases.

However, after looking at related optimizer rules:

  • initial physical planning
  • CombinePartialFinalAggregate
  • EnsureDistributions
  • and this rule

We can find only case 1 is possible, so the implementation can be simplified into a naive pattern matching

Find the exact below shape, and try push limits

LimitExec
--AggregateExec(mode=final)
----AggregateExec(mode=partial)

What changes are included in this PR?

  • simplify an optimizer rule according to the above rationale
  • fix a small bug

What is the testing strategy for this PR?

  • for bug fix, changes in slt
  • To ensure refactor correctness: no e2e test need to be changed

Are there any user-facing changes?

@github-actions github-actions Bot added optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Oct 6, 2026
if let Some(aggr) = plan.downcast_ref::<AggregateExec>() {
if found_match_aggr
&& let Some(parent_aggr) = match_aggr.downcast_ref::<AggregateExec>()
&& !parent_aggr.group_expr().eq(aggr.group_expr())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

bug fix: missing a as_final to adapt projection difference

(
AggregateMode::Final | AggregateMode::FinalPartitioned,
AggregateMode::Partial,
) if final_agg.group_expr() == &partial_agg.group_expr().as_final() => {}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👉🏼

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this check could be a method on AggregateExec -- mostly so that it could be given a name and better documented

Something like:

if final_agg.matches_partial(partial_agg) {
...
}

(not sure if that is a good name for it)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, refactored in c8986fd

@codecov-commenter

codecov-commenter commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.17949% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.72%. Comparing base (c3ef346) to head (c8986fd).
⚠️ Report is 39 commits behind head on main.

Files with missing lines Patch % Lines
...ical-optimizer/src/limited_distinct_aggregation.rs 88.23% 3 Missing and 1 partial ⚠️
datafusion/physical-plan/src/aggregates/mod.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26069      +/-   ##
==========================================
+ Coverage   82.66%   82.72%   +0.06%     
==========================================
  Files        1147     1147              
  Lines      446357   449144    +2787     
  Branches   446357   449144    +2787     
==========================================
+ Hits       368971   371555    +2584     
+ Misses      54997    54940      -57     
- Partials    22389    22649     +260     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @2010YOUY01 -- I think this is a nice cleanup and improves the output plans and the code readability

02)--AggregateExec: mode=Final, gby=[b@0 as b, a@1 as a], aggr=[], lim=[2]
03)----AggregateExec: mode=Partial, gby=[b@1 as b, a@0 as a], aggr=[]
04)------DataSourceExec: partitions=1, partition_sizes=[1]
02)--AggregateExec: mode=Single, gby=[b@1 as b, a@0 as a], aggr=[], lim=[2]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this does seem a better plan (use only the final single partition execution plan)

03)----AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3, __grouping_id@2 as __grouping_id], aggr=[], lim=[3]
04)------CoalescePartitionsExec
05)--------AggregateExec: mode=Partial, gby=[(NULL as c2, NULL as c3), (c2@0 as c2, NULL as c3), (c2@0 as c2, c3@1 as c3)], aggr=[]
05)--------AggregateExec: mode=Partial, gby=[(NULL as c2, NULL as c3), (c2@0 as c2, NULL as c3), (c2@0 as c2, c3@1 as c3)], aggr=[], lim=[3]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks correct to me -- to push the limit down into each partial aggregate / partition

/// Scan
/// ```
///
/// # Invariants before and after the rewrite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure I would use the term "invariant" here though it is technically accurate

This comment mostly explains the effect of this optimizer rule (what it does).

I normally think of Invariant as a property that will not change as any operation is applied to it. I don't think there is any reason to require that some future optimizer rule preserves the same property

For example, what if a future rule (or a user defined rule) has some additional special operator that requires the full intermediate results (aka undoes the soft limit on the Partial AggregateExec)? I don't see any reason to try and prevent that 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, 'invariant' is not precise here.

Here is the updated version in c8986fd

It should describe what it is today, but I think we could make this kind of assumption/promise description part of a template, require it as a comment section for all optimizer rules, and try to keep it maintained.

These assumptions are already there, but many of them are undocumented. I’m not sure exactly how we should do this yet, so I’ll keep thinking about it in the background.

/// # What this rule assumes
///
/// This rule assumes the logical aggregate only have one shape showed below, this
/// is what the current physical planning produces.
///
/// ```txt
/// Limit
///   AggregateExec(mode=Final)
///     AggregateExec(mode=Partial)
/// ```
///
/// If future changes or extensions produce a different shape, this rule skips the
/// rewrite rather than reporting an error, potentially missing an optimization
/// opportunity.
///
/// # What this rule promises
///
/// Immediately after an eligible rewrite, both stages have a soft-limit hint.
/// Otherwise, this rule leaves both stages unchanged.
///
/// If a later rule removes the limit, it won't affect correctness, but it may
/// miss an optimization opportunity.

fn transform_limit(
plan: Arc<dyn ExecutionPlan>,
) -> Result<Transformed<Arc<dyn ExecutionPlan>>> {
// Step 1: Identify the plan shape,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you -- these comments really make the code much easier to follow

(
AggregateMode::Final | AggregateMode::FinalPartitioned,
AggregateMode::Partial,
) if final_agg.group_expr() == &partial_agg.group_expr().as_final() => {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this check could be a method on AggregateExec -- mostly so that it could be given a name and better documented

Something like:

if final_agg.matches_partial(partial_agg) {
...
}

(not sure if that is a good name for it)

@alamb alamb changed the title refactor: Simplify LimitedDistinctAggregation optimizer rule refactor: Simplify LimitedDistinctAggregation optimizer rule, push limit in more cases Oct 6, 2026
@alamb

alamb commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

run benchmark sql_planner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c6015018674-3093-s4s4j 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing cleanup-limit-aggr (784d746) to 982fca6 (merge-base) diff

Run configuration
run benchmark sql_planner

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing cleanup-limit-aggr (784d746) to 982fca6 (merge-base) diff

Run configuration
run benchmark sql_planner
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

group                                                 HEAD                                    cleanup-limit-aggr
-----                                                 ----                                    ------------------
logical_aggregate_with_join                           1.00    342.2±1.66µs        ? ?/sec     1.00    343.2±1.65µs        ? ?/sec
logical_correlated_subquery_exists                    1.00    203.8±0.77µs        ? ?/sec     1.00    204.2±0.57µs        ? ?/sec
logical_correlated_subquery_in                        1.00    207.1±1.05µs        ? ?/sec     1.00    206.2±1.08µs        ? ?/sec
logical_distinct_many_columns                         1.00    293.8±1.00µs        ? ?/sec     1.01    297.3±0.91µs        ? ?/sec
logical_join_4_with_agg_and_filter                    1.00    190.0±0.82µs        ? ?/sec     1.01    192.8±1.11µs        ? ?/sec
logical_join_8_with_agg_sort_limit                    1.00    339.5±1.85µs        ? ?/sec     1.00    339.5±1.86µs        ? ?/sec
logical_join_chain_16                                 1.00    614.3±2.16µs        ? ?/sec     1.00    613.9±2.08µs        ? ?/sec
logical_join_chain_4                                  1.00     74.3±0.31µs        ? ?/sec     1.01     74.8±0.31µs        ? ?/sec
logical_join_chain_8                                  1.01    199.1±0.97µs        ? ?/sec     1.00    197.1±0.77µs        ? ?/sec
logical_multiple_subqueries                           1.00    386.4±1.62µs        ? ?/sec     1.00    386.1±1.77µs        ? ?/sec
logical_nested_cte_4_levels                           1.00    195.5±1.07µs        ? ?/sec     1.01    197.9±1.49µs        ? ?/sec
logical_plan_struct_join_agg_sort                     1.00    119.8±0.90µs        ? ?/sec     1.04    124.7±0.64µs        ? ?/sec
logical_plan_tpcds_all                                1.00     83.6±0.39ms        ? ?/sec     1.01     84.1±0.51ms        ? ?/sec
logical_plan_tpch_all                                 1.00      5.6±0.03ms        ? ?/sec     1.00      5.6±0.03ms        ? ?/sec
logical_scalar_subquery                               1.02    217.3±1.10µs        ? ?/sec     1.00    212.8±0.95µs        ? ?/sec
logical_select_all_from_1000                          1.00      7.2±0.03ms        ? ?/sec     1.01      7.3±0.02ms        ? ?/sec
logical_select_one_from_700                           1.00    225.3±1.05µs        ? ?/sec     1.00    225.4±1.17µs        ? ?/sec
logical_trivial_join_high_numbered_columns            1.00    205.3±1.27µs        ? ?/sec     1.00    204.6±1.33µs        ? ?/sec
logical_trivial_join_low_numbered_columns             1.00    192.4±1.22µs        ? ?/sec     1.00    192.7±1.35µs        ? ?/sec
logical_union_4_branches                              1.00    306.6±1.16µs        ? ?/sec     1.01    308.2±2.35µs        ? ?/sec
logical_union_8_branches                              1.00    619.1±6.85µs        ? ?/sec     1.01    624.3±6.76µs        ? ?/sec
logical_wide_aggregate_1000_exprs                     1.00     43.1±0.12ms        ? ?/sec     1.01     43.5±0.12ms        ? ?/sec
logical_wide_aggregate_100_exprs                      1.00   1555.1±6.63µs        ? ?/sec     1.01   1572.1±5.65µs        ? ?/sec
logical_wide_case_50_exprs                            1.00   1741.8±9.37µs        ? ?/sec     1.01  1764.0±14.47µs        ? ?/sec
logical_wide_filter_200_predicates                    1.00   1316.4±8.43µs        ? ?/sec     1.00  1322.1±12.11µs        ? ?/sec
logical_wide_filter_50_predicates                     1.00    340.1±1.35µs        ? ?/sec     1.01    342.6±2.26µs        ? ?/sec
optimizer_correlated_exists                           1.01    216.7±1.09µs        ? ?/sec     1.00    214.6±1.16µs        ? ?/sec
optimizer_join_4_with_agg_filter                      1.00    395.2±1.97µs        ? ?/sec     1.00    396.2±0.93µs        ? ?/sec
optimizer_join_chain_4                                1.00    154.9±0.30µs        ? ?/sec     1.01    156.6±0.41µs        ? ?/sec
optimizer_join_chain_8                                1.00    536.7±1.32µs        ? ?/sec     1.01    540.2±1.30µs        ? ?/sec
optimizer_select_all_from_1000                        1.00      7.1±0.02ms        ? ?/sec     1.00      7.1±0.01ms        ? ?/sec
optimizer_select_one_from_700                         1.00    233.8±1.21µs        ? ?/sec     1.00    233.7±2.63µs        ? ?/sec
optimizer_tpcds_all                                   1.00    282.1±0.86ms        ? ?/sec     1.01    286.3±1.36ms        ? ?/sec
optimizer_tpch_all                                    1.00     15.9±0.05ms        ? ?/sec     1.01     16.1±0.07ms        ? ?/sec
optimizer_wide_aggregate_100                          1.00   1750.9±4.41µs        ? ?/sec     1.00   1744.3±3.36µs        ? ?/sec
optimizer_wide_filter_200                             1.00      4.0±0.02ms        ? ?/sec     1.00      4.0±0.02ms        ? ?/sec
physical_intersection                                 1.00    495.1±2.40µs        ? ?/sec     1.03    508.4±5.02µs        ? ?/sec
physical_join_consider_sort                           1.00    945.7±2.09µs        ? ?/sec     1.02    964.4±4.82µs        ? ?/sec
physical_join_distinct                                1.01    186.7±1.19µs        ? ?/sec     1.00    185.5±1.22µs        ? ?/sec
physical_many_self_joins                              1.00      7.6±0.03ms        ? ?/sec     1.01      7.7±0.02ms        ? ?/sec
physical_plan_clickbench_all                          1.00    166.1±4.86ms        ? ?/sec     1.00    165.3±6.81ms        ? ?/sec
physical_plan_clickbench_q1                           1.01  1526.6±85.61µs        ? ?/sec     1.00  1509.6±92.09µs        ? ?/sec
physical_plan_clickbench_q10                          1.01      2.4±0.08ms        ? ?/sec     1.00      2.4±0.10ms        ? ?/sec
physical_plan_clickbench_q11                          1.00      2.6±0.09ms        ? ?/sec     1.01      2.6±0.06ms        ? ?/sec
physical_plan_clickbench_q12                          1.01      2.7±0.11ms        ? ?/sec     1.00      2.6±0.10ms        ? ?/sec
physical_plan_clickbench_q13                          1.02      2.5±0.06ms        ? ?/sec     1.00      2.5±0.07ms        ? ?/sec
physical_plan_clickbench_q14                          1.03      2.7±0.09ms        ? ?/sec     1.00      2.6±0.06ms        ? ?/sec
physical_plan_clickbench_q15                          1.03      2.5±0.11ms        ? ?/sec     1.00      2.4±0.17ms        ? ?/sec
physical_plan_clickbench_q16                          1.06      2.1±0.09ms        ? ?/sec     1.00      2.0±0.10ms        ? ?/sec
physical_plan_clickbench_q17                          1.04      2.2±0.10ms        ? ?/sec     1.00      2.1±0.12ms        ? ?/sec
physical_plan_clickbench_q18                          1.06      2.0±0.09ms        ? ?/sec     1.00  1890.7±122.64µs        ? ?/sec
physical_plan_clickbench_q19                          1.01      2.4±0.06ms        ? ?/sec     1.00      2.4±0.11ms        ? ?/sec
physical_plan_clickbench_q2                           1.03      2.1±0.12ms        ? ?/sec     1.00      2.0±0.13ms        ? ?/sec
physical_plan_clickbench_q20                          1.00  1810.5±77.35µs        ? ?/sec     1.04  1878.3±71.93µs        ? ?/sec
physical_plan_clickbench_q21                          1.00      2.1±0.11ms        ? ?/sec     1.06      2.2±0.09ms        ? ?/sec
physical_plan_clickbench_q22                          1.01      2.5±0.12ms        ? ?/sec     1.00      2.5±0.15ms        ? ?/sec
physical_plan_clickbench_q23                          1.06      2.8±0.07ms        ? ?/sec     1.00      2.6±0.12ms        ? ?/sec
physical_plan_clickbench_q24                          1.02      5.6±0.06ms        ? ?/sec     1.00      5.4±0.08ms        ? ?/sec
physical_plan_clickbench_q25                          1.03      2.2±0.08ms        ? ?/sec     1.00      2.1±0.08ms        ? ?/sec
physical_plan_clickbench_q26                          1.00  1965.9±135.30µs        ? ?/sec    1.02      2.0±0.09ms        ? ?/sec
physical_plan_clickbench_q27                          1.00      2.2±0.07ms        ? ?/sec     1.03      2.3±0.10ms        ? ?/sec
physical_plan_clickbench_q28                          1.00      2.7±0.06ms        ? ?/sec     1.01      2.7±0.11ms        ? ?/sec
physical_plan_clickbench_q29                          1.00      2.9±0.05ms        ? ?/sec     1.03      2.9±0.06ms        ? ?/sec
physical_plan_clickbench_q3                           1.00  1956.4±89.42µs        ? ?/sec     1.02  1993.6±70.54µs        ? ?/sec
physical_plan_clickbench_q30                          1.00     13.1±0.07ms        ? ?/sec     1.01     13.2±0.06ms        ? ?/sec
physical_plan_clickbench_q31                          1.00      2.8±0.11ms        ? ?/sec     1.04      2.9±0.05ms        ? ?/sec
physical_plan_clickbench_q32                          1.00      2.8±0.06ms        ? ?/sec     1.03      2.9±0.05ms        ? ?/sec
physical_plan_clickbench_q33                          1.00      2.3±0.12ms        ? ?/sec     1.01      2.3±0.14ms        ? ?/sec
physical_plan_clickbench_q34                          1.00  1988.9±122.99µs        ? ?/sec    1.04      2.1±0.14ms        ? ?/sec
physical_plan_clickbench_q35                          1.00      2.1±0.08ms        ? ?/sec     1.00      2.1±0.13ms        ? ?/sec
physical_plan_clickbench_q36                          1.00      2.4±0.11ms        ? ?/sec     1.10      2.6±0.05ms        ? ?/sec
physical_plan_clickbench_q37                          1.00      2.9±0.07ms        ? ?/sec     1.08      3.2±0.04ms        ? ?/sec
physical_plan_clickbench_q38                          1.00      2.9±0.06ms        ? ?/sec     1.08      3.2±0.05ms        ? ?/sec
physical_plan_clickbench_q39                          1.00      3.0±0.05ms        ? ?/sec     1.04      3.1±0.08ms        ? ?/sec
physical_plan_clickbench_q4                           1.00  1751.7±100.03µs        ? ?/sec    1.00  1745.5±67.75µs        ? ?/sec
physical_plan_clickbench_q40                          1.00      3.7±0.14ms        ? ?/sec     1.04      3.8±0.07ms        ? ?/sec
physical_plan_clickbench_q41                          1.00      3.3±0.12ms        ? ?/sec     1.04      3.4±0.04ms        ? ?/sec
physical_plan_clickbench_q42                          1.00      3.3±0.09ms        ? ?/sec     1.04      3.4±0.05ms        ? ?/sec
physical_plan_clickbench_q43                          1.00      3.5±0.07ms        ? ?/sec     1.03      3.6±0.08ms        ? ?/sec
physical_plan_clickbench_q44                          1.00  1689.7±89.87µs        ? ?/sec     1.10  1858.6±76.01µs        ? ?/sec
physical_plan_clickbench_q45                          1.00  1687.0±64.06µs        ? ?/sec     1.08  1820.1±84.18µs        ? ?/sec
physical_plan_clickbench_q46                          1.00  1979.7±105.67µs        ? ?/sec    1.09      2.2±0.12ms        ? ?/sec
physical_plan_clickbench_q47                          1.00      2.7±0.08ms        ? ?/sec     1.06      2.9±0.06ms        ? ?/sec
physical_plan_clickbench_q48                          1.00      3.0±0.08ms        ? ?/sec     1.02      3.1±0.09ms        ? ?/sec
physical_plan_clickbench_q49                          1.00      3.0±0.05ms        ? ?/sec     1.08      3.3±0.05ms        ? ?/sec
physical_plan_clickbench_q5                           1.00  1867.8±112.50µs        ? ?/sec    1.00  1865.2±62.07µs        ? ?/sec
physical_plan_clickbench_q50                          1.00      3.0±0.08ms        ? ?/sec     1.08      3.3±0.04ms        ? ?/sec
physical_plan_clickbench_q51                          1.00      2.1±0.09ms        ? ?/sec     1.13      2.4±0.08ms        ? ?/sec
physical_plan_clickbench_q52                          1.00      2.7±0.08ms        ? ?/sec     1.04      2.9±0.09ms        ? ?/sec
physical_plan_clickbench_q53                          1.00  1974.5±78.56µs        ? ?/sec     1.05      2.1±0.12ms        ? ?/sec
physical_plan_clickbench_q54                          1.00  1897.6±80.48µs        ? ?/sec     1.10      2.1±0.07ms        ? ?/sec
physical_plan_clickbench_q55                          1.00  1802.4±73.82µs        ? ?/sec     1.18      2.1±0.06ms        ? ?/sec
physical_plan_clickbench_q56                          1.00  1847.8±42.87µs        ? ?/sec     1.11      2.1±0.12ms        ? ?/sec
physical_plan_clickbench_q57                          1.00      2.0±0.09ms        ? ?/sec     1.08      2.2±0.12ms        ? ?/sec
physical_plan_clickbench_q58                          1.00      2.6±0.07ms        ? ?/sec     1.07      2.8±0.07ms        ? ?/sec
physical_plan_clickbench_q59                          1.02      2.0±0.06ms        ? ?/sec     1.00      2.0±0.08ms        ? ?/sec
physical_plan_clickbench_q6                           1.07  1890.7±82.45µs        ? ?/sec     1.00  1770.7±112.86µs        ? ?/sec
physical_plan_clickbench_q60                          1.00  1897.5±75.62µs        ? ?/sec     1.06      2.0±0.12ms        ? ?/sec
physical_plan_clickbench_q7                           1.00  1567.8±118.89µs        ? ?/sec    1.04  1623.1±82.25µs        ? ?/sec
physical_plan_clickbench_q8                           1.01      2.3±0.11ms        ? ?/sec     1.00      2.3±0.10ms        ? ?/sec
physical_plan_clickbench_q9                           1.02      2.2±0.11ms        ? ?/sec     1.00      2.2±0.14ms        ? ?/sec
physical_plan_struct_join_agg_sort                    1.00   1199.3±6.97µs        ? ?/sec     1.03  1235.1±19.79µs        ? ?/sec
physical_plan_tpcds_all                               1.00    671.6±7.20ms        ? ?/sec     1.01    678.2±8.87ms        ? ?/sec
physical_plan_tpch_all                                1.00     45.9±1.37ms        ? ?/sec     1.06     48.5±0.72ms        ? ?/sec
physical_plan_tpch_q1                                 1.00  1412.6±30.47µs        ? ?/sec     1.06  1493.8±19.95µs        ? ?/sec
physical_plan_tpch_q10                                1.00      2.4±0.04ms        ? ?/sec     1.08      2.6±0.04ms        ? ?/sec
physical_plan_tpch_q11                                1.00      2.2±0.06ms        ? ?/sec     1.07      2.4±0.07ms        ? ?/sec
physical_plan_tpch_q12                                1.00  1221.2±11.14µs        ? ?/sec     1.06  1292.3±38.55µs        ? ?/sec
physical_plan_tpch_q13                                1.00    993.1±6.12µs        ? ?/sec     1.03  1025.3±17.33µs        ? ?/sec
physical_plan_tpch_q14                                1.00   1299.3±9.45µs        ? ?/sec     1.05  1358.3±33.67µs        ? ?/sec
physical_plan_tpch_q16                                1.00  1610.3±20.40µs        ? ?/sec     1.08  1737.0±59.11µs        ? ?/sec
physical_plan_tpch_q17                                1.00  1617.6±17.54µs        ? ?/sec     1.12  1813.6±38.45µs        ? ?/sec
physical_plan_tpch_q18                                1.00  1941.2±27.50µs        ? ?/sec     1.12      2.2±0.04ms        ? ?/sec
physical_plan_tpch_q19                                1.00  1905.4±61.10µs        ? ?/sec     1.02  1941.1±41.40µs        ? ?/sec
physical_plan_tpch_q2                                 1.00      3.6±0.12ms        ? ?/sec     1.06      3.9±0.03ms        ? ?/sec
physical_plan_tpch_q20                                1.04      2.4±0.06ms        ? ?/sec     1.00      2.3±0.09ms        ? ?/sec
physical_plan_tpch_q21                                1.04      3.0±0.06ms        ? ?/sec     1.00      2.9±0.05ms        ? ?/sec
physical_plan_tpch_q22                                1.00  1659.5±106.75µs        ? ?/sec    1.01  1674.6±70.20µs        ? ?/sec
physical_plan_tpch_q3                                 1.00  1739.1±41.60µs        ? ?/sec     1.04  1813.0±31.10µs        ? ?/sec
physical_plan_tpch_q4                                 1.00  1112.8±24.22µs        ? ?/sec     1.01  1120.3±15.24µs        ? ?/sec
physical_plan_tpch_q5                                 1.00      2.6±0.05ms        ? ?/sec     1.01      2.6±0.08ms        ? ?/sec
physical_plan_tpch_q6                                 1.00    575.6±2.19µs        ? ?/sec     1.03    591.0±3.14µs        ? ?/sec
physical_plan_tpch_q7                                 1.01      2.9±0.12ms        ? ?/sec     1.00      2.9±0.09ms        ? ?/sec
physical_plan_tpch_q8                                 1.01      4.0±0.03ms        ? ?/sec     1.00      4.0±0.04ms        ? ?/sec
physical_plan_tpch_q9                                 1.00      2.9±0.04ms        ? ?/sec     1.02      2.9±0.04ms        ? ?/sec
physical_select_aggregates_from_200                   1.00      7.8±0.02ms        ? ?/sec     1.01      7.8±0.02ms        ? ?/sec
physical_select_all_from_1000                         1.00     17.8±0.06ms        ? ?/sec     1.01     17.9±0.04ms        ? ?/sec
physical_select_one_from_700                          1.00    623.7±4.13µs        ? ?/sec     1.01    627.6±2.49µs        ? ?/sec
physical_sorted_union_order_by_10_int64               1.00      3.7±0.03ms        ? ?/sec     1.02      3.8±0.08ms        ? ?/sec
physical_sorted_union_order_by_10_uint64              1.00      7.1±0.02ms        ? ?/sec     1.02      7.2±0.02ms        ? ?/sec
physical_sorted_union_order_by_50_int64               1.00     81.9±0.28ms        ? ?/sec     1.02     83.5±0.41ms        ? ?/sec
physical_sorted_union_order_by_50_uint64              1.00    270.4±1.39ms        ? ?/sec     1.02    275.5±2.31ms        ? ?/sec
physical_theta_join_consider_sort                     1.00    963.2±2.16µs        ? ?/sec     1.04    998.5±5.48µs        ? ?/sec
physical_unnest_to_join                               1.00    533.5±1.93µs        ? ?/sec     1.04    553.1±6.18µs        ? ?/sec
physical_window_function_partition_by_12_on_values    1.00    624.4±2.05µs        ? ?/sec     1.01    632.3±1.69µs        ? ?/sec
physical_window_function_partition_by_30_on_values    1.00   1260.3±6.15µs        ? ?/sec     1.03   1294.7±9.63µs        ? ?/sec
physical_window_function_partition_by_4_on_values     1.00    378.5±2.92µs        ? ?/sec     1.03    390.0±0.89µs        ? ?/sec
physical_window_function_partition_by_7_on_values     1.00    469.9±5.85µs        ? ?/sec     1.02    480.9±1.11µs        ? ?/sec
physical_window_function_partition_by_8_on_values     1.01    514.1±2.04µs        ? ?/sec     1.00    510.2±1.67µs        ? ?/sec
with_param_values_many_columns                        1.00    378.6±2.62µs        ? ?/sec     1.00    378.1±2.24µs        ? ?/sec

Resource Usage

sql_planner — base (merge-base)

Metric Value
Wall time 1990.4s
Peak memory 142.0 MiB
Avg memory 93.2 MiB
CPU user 1965.4s
CPU sys 1.4s
Peak spill 0 B

sql_planner — branch

Metric Value
Wall time 1990.5s
Peak memory 139.4 MiB
Avg memory 89.0 MiB
CPU user 1933.4s
CPU sys 1.6s
Peak spill 0 B

File an issue against this benchmark runner

@alamb

alamb commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

run benchmarks sql_planner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c6020678941-3098-4cln4 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing cleanup-limit-aggr (784d746) to 982fca6 (merge-base) diff

Run configuration
run benchmark sql_planner

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing cleanup-limit-aggr (784d746) to 982fca6 (merge-base) diff

Run configuration
run benchmark sql_planner
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

group                                                 HEAD                                   cleanup-limit-aggr
-----                                                 ----                                   ------------------
logical_aggregate_with_join                           1.00    342.2±1.52µs        ? ?/sec    1.00    341.7±1.55µs        ? ?/sec
logical_correlated_subquery_exists                    1.00    203.6±0.65µs        ? ?/sec    1.00    204.1±1.28µs        ? ?/sec
logical_correlated_subquery_in                        1.00    205.0±1.35µs        ? ?/sec    1.01    206.1±1.54µs        ? ?/sec
logical_distinct_many_columns                         1.00    292.4±0.91µs        ? ?/sec    1.01    294.4±0.93µs        ? ?/sec
logical_join_4_with_agg_and_filter                    1.00    191.8±0.80µs        ? ?/sec    1.00    191.4±0.81µs        ? ?/sec
logical_join_8_with_agg_sort_limit                    1.00    338.9±1.52µs        ? ?/sec    1.00    338.0±1.61µs        ? ?/sec
logical_join_chain_16                                 1.00    613.1±1.57µs        ? ?/sec    1.01    617.6±5.46µs        ? ?/sec
logical_join_chain_4                                  1.00     73.4±0.19µs        ? ?/sec    1.01     74.1±0.30µs        ? ?/sec
logical_join_chain_8                                  1.00    197.6±0.53µs        ? ?/sec    1.00    197.6±0.72µs        ? ?/sec
logical_multiple_subqueries                           1.00    387.6±1.56µs        ? ?/sec    1.03    398.5±1.87µs        ? ?/sec
logical_nested_cte_4_levels                           1.00    196.7±1.53µs        ? ?/sec    1.00    197.6±1.56µs        ? ?/sec
logical_plan_struct_join_agg_sort                     1.00    120.9±0.75µs        ? ?/sec    1.03    124.4±1.05µs        ? ?/sec
logical_plan_tpcds_all                                1.01     80.6±0.14ms        ? ?/sec    1.00     80.2±0.13ms        ? ?/sec
logical_plan_tpch_all                                 1.00      5.6±0.02ms        ? ?/sec    1.00      5.6±0.02ms        ? ?/sec
logical_scalar_subquery                               1.00    213.9±1.08µs        ? ?/sec    1.01    215.6±6.88µs        ? ?/sec
logical_select_all_from_1000                          1.00      7.2±0.03ms        ? ?/sec    1.01      7.3±0.03ms        ? ?/sec
logical_select_one_from_700                           1.00    224.6±1.19µs        ? ?/sec    1.00    224.3±1.13µs        ? ?/sec
logical_trivial_join_high_numbered_columns            1.00    204.4±1.28µs        ? ?/sec    1.00    204.6±1.07µs        ? ?/sec
logical_trivial_join_low_numbered_columns             1.00    192.4±1.23µs        ? ?/sec    1.00    192.6±1.30µs        ? ?/sec
logical_union_4_branches                              1.00    305.5±1.31µs        ? ?/sec    1.00    306.4±1.09µs        ? ?/sec
logical_union_8_branches                              1.01    623.5±3.05µs        ? ?/sec    1.00    617.9±2.95µs        ? ?/sec
logical_wide_aggregate_1000_exprs                     1.00     42.5±0.17ms        ? ?/sec    1.00     42.6±0.07ms        ? ?/sec
logical_wide_aggregate_100_exprs                      1.00   1544.1±3.46µs        ? ?/sec    1.00   1551.7±3.73µs        ? ?/sec
logical_wide_case_50_exprs                            1.00  1729.8±11.32µs        ? ?/sec    1.00   1723.1±5.42µs        ? ?/sec
logical_wide_filter_200_predicates                    1.00   1304.2±6.55µs        ? ?/sec    1.00   1304.5±6.56µs        ? ?/sec
logical_wide_filter_50_predicates                     1.00    340.2±1.41µs        ? ?/sec    1.00    341.5±1.31µs        ? ?/sec
optimizer_correlated_exists                           1.00    212.6±0.42µs        ? ?/sec    1.00    213.5±0.57µs        ? ?/sec
optimizer_join_4_with_agg_filter                      1.00    388.7±0.92µs        ? ?/sec    1.02    396.8±1.77µs        ? ?/sec
optimizer_join_chain_4                                1.00    154.5±0.21µs        ? ?/sec    1.02    157.7±0.22µs        ? ?/sec
optimizer_join_chain_8                                1.00    535.7±2.06µs        ? ?/sec    1.00    536.0±1.14µs        ? ?/sec
optimizer_select_all_from_1000                        1.00      7.0±0.02ms        ? ?/sec    1.00      7.0±0.01ms        ? ?/sec
optimizer_select_one_from_700                         1.00    231.5±0.34µs        ? ?/sec    1.00    232.1±0.53µs        ? ?/sec
optimizer_tpcds_all                                   1.00    274.8±0.35ms        ? ?/sec    1.01    278.8±0.89ms        ? ?/sec
optimizer_tpch_all                                    1.00     15.4±0.04ms        ? ?/sec    1.02     15.7±0.03ms        ? ?/sec
optimizer_wide_aggregate_100                          1.00   1742.2±2.83µs        ? ?/sec    1.00   1748.0±6.03µs        ? ?/sec
optimizer_wide_filter_200                             1.00      3.9±0.01ms        ? ?/sec    1.01      3.9±0.01ms        ? ?/sec
physical_intersection                                 1.00    500.8±1.67µs        ? ?/sec    1.00    500.5±1.86µs        ? ?/sec
physical_join_consider_sort                           1.00    959.2±4.83µs        ? ?/sec    1.00    957.0±2.08µs        ? ?/sec
physical_join_distinct                                1.00    185.8±1.21µs        ? ?/sec    1.00    185.3±1.14µs        ? ?/sec
physical_many_self_joins                              1.00      7.5±0.02ms        ? ?/sec    1.00      7.5±0.02ms        ? ?/sec
physical_plan_clickbench_all                          1.00    131.7±0.35ms        ? ?/sec    1.01    132.7±0.35ms        ? ?/sec
physical_plan_clickbench_q1                           1.00   1335.1±6.40µs        ? ?/sec    1.00   1339.8±8.06µs        ? ?/sec
physical_plan_clickbench_q10                          1.00   1875.0±8.11µs        ? ?/sec    1.03   1927.7±7.06µs        ? ?/sec
physical_plan_clickbench_q11                          1.00      2.0±0.01ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
physical_plan_clickbench_q12                          1.00      2.1±0.01ms        ? ?/sec    1.01      2.1±0.01ms        ? ?/sec
physical_plan_clickbench_q13                          1.01   1906.3±7.83µs        ? ?/sec    1.00   1895.4±8.61µs        ? ?/sec
physical_plan_clickbench_q14                          1.01      2.1±0.01ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
physical_plan_clickbench_q15                          1.02   1989.5±8.31µs        ? ?/sec    1.00   1956.2±8.08µs        ? ?/sec
physical_plan_clickbench_q16                          1.00   1654.7±7.96µs        ? ?/sec    1.01   1666.3±6.00µs        ? ?/sec
physical_plan_clickbench_q17                          1.01   1731.2±4.72µs        ? ?/sec    1.00   1715.1±6.99µs        ? ?/sec
physical_plan_clickbench_q18                          1.00   1564.9±4.78µs        ? ?/sec    1.00   1561.4±5.24µs        ? ?/sec
physical_plan_clickbench_q19                          1.00   1907.4±6.74µs        ? ?/sec    1.00   1902.3±5.89µs        ? ?/sec
physical_plan_clickbench_q2                           1.00   1644.8±5.04µs        ? ?/sec    1.01   1668.5±6.28µs        ? ?/sec
physical_plan_clickbench_q20                          1.00   1488.4±5.31µs        ? ?/sec    1.01  1504.9±10.19µs        ? ?/sec
physical_plan_clickbench_q21                          1.00   1656.6±6.68µs        ? ?/sec    1.02   1685.0±5.82µs        ? ?/sec
physical_plan_clickbench_q22                          1.00      2.0±0.01ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
physical_plan_clickbench_q23                          1.00      2.1±0.01ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q24                          1.00      4.9±0.03ms        ? ?/sec    1.00      4.9±0.02ms        ? ?/sec
physical_plan_clickbench_q25                          1.00   1765.0±7.22µs        ? ?/sec    1.01   1779.6±5.93µs        ? ?/sec
physical_plan_clickbench_q26                          1.00   1636.2±6.11µs        ? ?/sec    1.01   1652.7±7.73µs        ? ?/sec
physical_plan_clickbench_q27                          1.00   1800.2±7.81µs        ? ?/sec    1.02   1843.9±7.21µs        ? ?/sec
physical_plan_clickbench_q28                          1.00      2.1±0.01ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
physical_plan_clickbench_q29                          1.00      2.3±0.01ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q3                           1.00   1543.6±6.57µs        ? ?/sec    1.01   1562.3±5.22µs        ? ?/sec
physical_plan_clickbench_q30                          1.00     12.7±0.05ms        ? ?/sec    1.00     12.7±0.05ms        ? ?/sec
physical_plan_clickbench_q31                          1.00      2.2±0.01ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q32                          1.01      2.2±0.01ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q33                          1.00   1882.6±7.10µs        ? ?/sec    1.02   1921.8±6.56µs        ? ?/sec
physical_plan_clickbench_q34                          1.00  1672.2±11.08µs        ? ?/sec    1.01   1685.1±6.22µs        ? ?/sec
physical_plan_clickbench_q35                          1.00   1731.3±6.46µs        ? ?/sec    1.00   1729.5±5.77µs        ? ?/sec
physical_plan_clickbench_q36                          1.01   1999.1±8.20µs        ? ?/sec    1.00   1988.1±6.61µs        ? ?/sec
physical_plan_clickbench_q37                          1.00      2.4±0.01ms        ? ?/sec    1.00      2.4±0.01ms        ? ?/sec
physical_plan_clickbench_q38                          1.00      2.4±0.01ms        ? ?/sec    1.02      2.4±0.02ms        ? ?/sec
physical_plan_clickbench_q39                          1.00      2.4±0.01ms        ? ?/sec    1.01      2.5±0.01ms        ? ?/sec
physical_plan_clickbench_q4                           1.00   1390.8±6.45µs        ? ?/sec    1.01   1408.1±4.75µs        ? ?/sec
physical_plan_clickbench_q40                          1.00      3.1±0.01ms        ? ?/sec    1.01      3.1±0.01ms        ? ?/sec
physical_plan_clickbench_q41                          1.00      2.7±0.01ms        ? ?/sec    1.01      2.7±0.01ms        ? ?/sec
physical_plan_clickbench_q42                          1.00      2.8±0.02ms        ? ?/sec    1.01      2.8±0.01ms        ? ?/sec
physical_plan_clickbench_q43                          1.00      2.9±0.02ms        ? ?/sec    1.02      3.0±0.01ms        ? ?/sec
physical_plan_clickbench_q44                          1.00   1466.6±4.59µs        ? ?/sec    1.03   1505.2±5.09µs        ? ?/sec
physical_plan_clickbench_q45                          1.00   1482.0±7.35µs        ? ?/sec    1.01   1496.8±4.25µs        ? ?/sec
physical_plan_clickbench_q46                          1.00   1696.0±6.37µs        ? ?/sec    1.04   1769.8±5.33µs        ? ?/sec
physical_plan_clickbench_q47                          1.00      2.3±0.01ms        ? ?/sec    1.03      2.3±0.01ms        ? ?/sec
physical_plan_clickbench_q48                          1.00      2.4±0.01ms        ? ?/sec    1.02      2.5±0.02ms        ? ?/sec
physical_plan_clickbench_q49                          1.00      2.5±0.01ms        ? ?/sec    1.00      2.5±0.02ms        ? ?/sec
physical_plan_clickbench_q5                           1.00   1508.4±6.53µs        ? ?/sec    1.02   1535.0±7.91µs        ? ?/sec
physical_plan_clickbench_q50                          1.00      2.5±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
physical_plan_clickbench_q51                          1.00   1860.1±7.31µs        ? ?/sec    1.00   1866.4±7.76µs        ? ?/sec
physical_plan_clickbench_q52                          1.01      2.3±0.01ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
physical_plan_clickbench_q53                          1.00   1695.6±5.68µs        ? ?/sec    1.01   1710.1±5.39µs        ? ?/sec
physical_plan_clickbench_q54                          1.00   1681.5±6.24µs        ? ?/sec    1.00   1675.3±7.19µs        ? ?/sec
physical_plan_clickbench_q55                          1.00   1617.6±5.71µs        ? ?/sec    1.00   1617.9±4.91µs        ? ?/sec
physical_plan_clickbench_q56                          1.00   1608.2±4.42µs        ? ?/sec    1.02   1648.0±7.29µs        ? ?/sec
physical_plan_clickbench_q57                          1.00   1729.9±6.08µs        ? ?/sec    1.00   1733.6±6.31µs        ? ?/sec
physical_plan_clickbench_q58                          1.00      2.2±0.01ms        ? ?/sec    1.01      2.2±0.01ms        ? ?/sec
physical_plan_clickbench_q59                          1.00   1615.5±4.85µs        ? ?/sec    1.03  1657.7±11.52µs        ? ?/sec
physical_plan_clickbench_q6                           1.01   1518.7±7.04µs        ? ?/sec    1.00   1505.5±4.97µs        ? ?/sec
physical_plan_clickbench_q60                          1.00   1623.1±6.46µs        ? ?/sec    1.02   1659.2±9.08µs        ? ?/sec
physical_plan_clickbench_q7                           1.01   1390.6±5.00µs        ? ?/sec    1.00  1374.2±11.63µs        ? ?/sec
physical_plan_clickbench_q8                           1.02   1889.4±9.05µs        ? ?/sec    1.00   1846.4±5.55µs        ? ?/sec
physical_plan_clickbench_q9                           1.01  1799.4±11.78µs        ? ?/sec    1.00   1779.3±6.32µs        ? ?/sec
physical_plan_struct_join_agg_sort                    1.00   1191.2±2.23µs        ? ?/sec    1.01   1200.5±9.53µs        ? ?/sec
physical_plan_tpcds_all                               1.01    637.5±0.92ms        ? ?/sec    1.00    632.8±1.03ms        ? ?/sec
physical_plan_tpch_all                                1.00     41.8±0.09ms        ? ?/sec    1.01     42.4±0.32ms        ? ?/sec
physical_plan_tpch_q1                                 1.00   1409.0±3.91µs        ? ?/sec    1.00   1406.3±3.09µs        ? ?/sec
physical_plan_tpch_q10                                1.00      2.3±0.00ms        ? ?/sec    1.01      2.3±0.00ms        ? ?/sec
physical_plan_tpch_q11                                1.00      2.1±0.00ms        ? ?/sec    1.00      2.1±0.00ms        ? ?/sec
physical_plan_tpch_q12                                1.01   1210.7±2.42µs        ? ?/sec    1.00   1198.6±2.81µs        ? ?/sec
physical_plan_tpch_q13                                1.00    987.5±1.69µs        ? ?/sec    1.00    987.2±2.03µs        ? ?/sec
physical_plan_tpch_q14                                1.00   1282.1±3.31µs        ? ?/sec    1.01   1295.9±5.33µs        ? ?/sec
physical_plan_tpch_q16                                1.00   1557.8±2.83µs        ? ?/sec    1.00   1561.5±2.74µs        ? ?/sec
physical_plan_tpch_q17                                1.00  1599.0±10.00µs        ? ?/sec    1.01   1621.8±3.02µs        ? ?/sec
physical_plan_tpch_q18                                1.00   1850.7±2.84µs        ? ?/sec    1.02   1879.5±3.40µs        ? ?/sec
physical_plan_tpch_q19                                1.00   1784.6±3.26µs        ? ?/sec    1.02   1819.9±4.29µs        ? ?/sec
physical_plan_tpch_q2                                 1.00      3.5±0.01ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
physical_plan_tpch_q20                                1.00      2.0±0.00ms        ? ?/sec    1.01      2.0±0.00ms        ? ?/sec
physical_plan_tpch_q21                                1.00      2.6±0.01ms        ? ?/sec    1.00      2.6±0.00ms        ? ?/sec
physical_plan_tpch_q22                                1.00   1462.8±9.25µs        ? ?/sec    1.01   1478.4±3.05µs        ? ?/sec
physical_plan_tpch_q3                                 1.00   1685.2±3.27µs        ? ?/sec    1.02   1720.1±6.03µs        ? ?/sec
physical_plan_tpch_q4                                 1.00   1077.6±2.35µs        ? ?/sec    1.00   1081.2±2.46µs        ? ?/sec
physical_plan_tpch_q5                                 1.00      2.4±0.00ms        ? ?/sec    1.02      2.4±0.02ms        ? ?/sec
physical_plan_tpch_q6                                 1.01    580.6±1.46µs        ? ?/sec    1.00    576.5±1.29µs        ? ?/sec
physical_plan_tpch_q7                                 1.00      2.6±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
physical_plan_tpch_q8                                 1.01      3.6±0.01ms        ? ?/sec    1.00      3.6±0.03ms        ? ?/sec
physical_plan_tpch_q9                                 1.01      2.6±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
physical_select_aggregates_from_200                   1.00      7.5±0.03ms        ? ?/sec    1.01      7.6±0.02ms        ? ?/sec
physical_select_all_from_1000                         1.00     17.7±0.04ms        ? ?/sec    1.01     17.8±0.08ms        ? ?/sec
physical_select_one_from_700                          1.00    619.9±2.11µs        ? ?/sec    1.01    623.9±1.72µs        ? ?/sec
physical_sorted_union_order_by_10_int64               1.00      3.6±0.01ms        ? ?/sec    1.00      3.6±0.01ms        ? ?/sec
physical_sorted_union_order_by_10_uint64              1.00      6.8±0.02ms        ? ?/sec    1.00      6.8±0.02ms        ? ?/sec
physical_sorted_union_order_by_50_int64               1.00     80.3±0.19ms        ? ?/sec    1.00     80.3±0.18ms        ? ?/sec
physical_sorted_union_order_by_50_uint64              1.00    262.2±0.62ms        ? ?/sec    1.00    262.5±0.78ms        ? ?/sec
physical_theta_join_consider_sort                     1.00    981.6±2.16µs        ? ?/sec    1.00    981.8±2.31µs        ? ?/sec
physical_unnest_to_join                               1.00    539.1±2.02µs        ? ?/sec    1.00    540.5±2.66µs        ? ?/sec
physical_window_function_partition_by_12_on_values    1.01    641.7±2.17µs        ? ?/sec    1.00    634.9±1.34µs        ? ?/sec
physical_window_function_partition_by_30_on_values    1.00   1256.8±6.52µs        ? ?/sec    1.01   1271.5±4.27µs        ? ?/sec
physical_window_function_partition_by_4_on_values     1.00    387.1±0.89µs        ? ?/sec    1.02    395.9±1.03µs        ? ?/sec
physical_window_function_partition_by_7_on_values     1.02    487.8±0.80µs        ? ?/sec    1.00    476.6±0.80µs        ? ?/sec
physical_window_function_partition_by_8_on_values     1.00    522.9±1.26µs        ? ?/sec    1.02    533.2±1.63µs        ? ?/sec
with_param_values_many_columns                        1.00    378.0±2.18µs        ? ?/sec    1.00    378.0±2.04µs        ? ?/sec

Resource Usage

sql_planner — base (merge-base)

Metric Value
Wall time 1795.4s
Peak memory 136.0 MiB
Avg memory 99.8 MiB
CPU user 1982.6s
CPU sys 1.6s
Peak spill 0 B

sql_planner — branch

Metric Value
Wall time 1800.4s
Peak memory 137.7 MiB
Avg memory 101.3 MiB
CPU user 1994.8s
CPU sys 1.6s
Peak spill 0 B

File an issue against this benchmark runner

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Oct 7, 2026
/// ```
///
/// # Invariants before and after the rewrite
/// # What this rule assumes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 like the wording

@alamb

alamb commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thank you @2010YOUY01

@alamb
alamb added this pull request to the merge queue Oct 8, 2026
Merged via the queue into apache:main with commit 97c7593 Oct 8, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate optimizer Optimizer rules physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt) v56.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants