Skip to content

refactor(hash-aggr): Migrate ordered partial/final aggregation#23181

Merged
2010YOUY01 merged 13 commits into
apache:mainfrom
2010YOUY01:split-aggr-ordered
Jul 3, 2026
Merged

refactor(hash-aggr): Migrate ordered partial/final aggregation#23181
2010YOUY01 merged 13 commits into
apache:mainfrom
2010YOUY01:split-aggr-ordered

Conversation

@2010YOUY01

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

Part of #22710

This PRs implements the cases that input is ordered by group keys.

Comments at datafusion/physical-plan/src/aggregates/ordered_partial_stream.rs explains the high-level idea.

What changes are included in this PR?

  1. Implement two aggregate tables for ordered partial/final aggregates. It provides a simple abstraction to the control flow: its logically a map from group keys to group states, and internally handles the low-level details
  2. Implement two streams for ordered partial/final aggregates

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions Bot added core Core DataFusion crate physical-plan Changes to the physical-plan crate labels Jun 25, 2026
assert!(collected_running.len() > 2);
// Running should produce more chunk than the usual AggregateExec.
// Otherwise it means that we cannot generate result in running mode.
assert!(collected_running.len() > collected_usual.len());

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.

This is asserting: we run the same query on OrderedAggregateStream and AggregateStream, the first one should return more number of batches.

This is implementation dependent, and later it will compare the whole result row-by-row, so it's safe to delete

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 think this is actually because the output is not being clamped to the specified record_batch size

I made a PR that targets your branch with a proposed fix here:

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.

This makes sense with the current implementation.

However, in the future, we might want to accumulate batch_size groups before emitting, so downstream operators can be better vectorized. In that case, this assertion would no longer hold.

So we would need a different assertion to check whether the ordered aggregation variant is used, likely via EXPLAIN. However, let's delay that change until this idea is actually implemented.

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.

/// `k = 100`, it is safe to emit all groups with keys less than 100 because the
/// input is ordered.
///
/// ## Implementation Note

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.

It's obvious there are many applicable optimizations for this path, here is the explanation why this PR tends to keep it simple.

}

#[tokio::test]
async fn ordered_partial_aggregate_partially_sorted_no_emit_panic() -> Result<()> {

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.

This test case is migrated from row_hash.rs's existing UT, and there is a comment left at the original test, so we can check it easier when deleting the old implementation eventually.

@alamb

alamb commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

run benchmarks

@alamb

alamb commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

run benchmark clickbench_sorted

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4846608110-754-tkrlr 6.12.85+ #1 SMP Mon May 11 08:17:35 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 split-aggr-ordered (59864f2) to 8511e18 (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4846608110-756-2lt82 6.12.85+ #1 SMP Mon May 11 08:17:35 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 split-aggr-ordered (59864f2) to 8511e18 (merge-base) diff using: tpch
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4846608110-755-sx45r 6.12.85+ #1 SMP Mon May 11 08:17:35 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 split-aggr-ordered (59864f2) to 8511e18 (merge-base) diff using: tpcds
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4846621322-757-ngz6r 6.12.85+ #1 SMP Mon May 11 08:17:35 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 split-aggr-ordered (59864f2) to 8511e18 (merge-base) diff using: clickbench_sorted
Results will be posted here when complete


File an issue against this benchmark runner

@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

Before merging this I think we should:

  1. revert the change in the fuzz test (I left a proposal about how to do so)
  2. make sure we don't see any regression in performance benchmarks (I will kick them off)

Longer term it would be nice to have some way to reduce the duplication (I realize some in inevitable, but there is a lot I think that is unecessary)


/// Buffer for the ordered aggregate table's group keys and accumulator states.
///
/// It accumulates input during aggregation and emits output rows as soon as the

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.

these are really nice, easy to understand, comments

Comment thread datafusion/physical-plan/src/aggregates/aggregate_hash_table/mod.rs
Comment thread datafusion/physical-plan/src/aggregates/mod.rs Outdated
assert!(collected_running.len() > 2);
// Running should produce more chunk than the usual AggregateExec.
// Otherwise it means that we cannot generate result in running mode.
assert!(collected_running.len() > collected_usual.len());

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 think this is actually because the output is not being clamped to the specified record_batch size

I made a PR that targets your branch with a proposed fix here:


/// Methods shared by all aggregate modes
impl<AggrMode> OrderedAggregateTable<AggrMode> {
pub(super) fn new_for_mode(

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.

One thought I had (for a future PR) is to potentially avoid some of this duplication by using a builder style here instead -- so something like

OrderedAggregateTableBuilder::new()
  .with_agg(..)
  ...
  .build<AggrMode>()

Comment thread datafusion/physical-plan/src/aggregates/aggregate_hash_table/common_ordered.rs Outdated
fn should_use_ordered_final_aggregate_stream(&self) -> bool {
matches!(
self.mode,
AggregateMode::Final | AggregateMode::FinalPartitioned

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.

codex also notes that the exising code doesn't use the partial group by operator when memory limited, as the new tables don't seem to handle the OOM path (though maybe I missed that)

This is somewhat unobviously implemented by OutOfMemoryMode choice here

  • let group_ordering = GroupOrdering::try_new(&agg.input_order_mode)?;
    let oom_mode = match (agg.mode, &group_ordering) {
    // In partial aggregation mode, always prefer to emit incomplete results early.
    (AggregateMode::Partial, _) => OutOfMemoryMode::EmitEarly,
    // For non-partial aggregation modes, emitting incomplete results is not an option.
    // Instead, use disk spilling to store sorted, incomplete results, and merge them
    // afterwards.
    (_, GroupOrdering::None | GroupOrdering::Partial(_))
    if context.runtime_env().disk_manager.tmp_files_enabled() =>
    {
    OutOfMemoryMode::Spill
    }
    // For `GroupOrdering::Full`, the incoming stream is already sorted. This ensures the
    // number of incomplete groups can be kept small at all times. If we still hit
    // an out-of-memory condition, spilling to disk would not be beneficial since the same
    // situation is likely to reoccur when reading back the spilled data.
    // Therefore, we fall back to simply reporting the error immediately.
    // This mode will also be used if the `DiskManager` is not configured to allow spilling
    // to disk.
    _ => OutOfMemoryMode::ReportError,

And a proposed PR to fix

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.

Yes, the existing behavior is, if there is memory limit, ordered aggregation case fallback to regular hash aggregation path (no ordering optimization) for the spilling.

This is intended for partially ordered case, since it might OOM, and we haven't implement spilling for that.

For fully ordered cases, this is not necessary, since it ensures always use bounded memory, but there is no existing testing coverage for that, probably in a follow-up PR, we can enable ordered fast path even there is a memory limit.

Patch applied in c2ae7dc

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

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

Comparing HEAD and split-aggr-ordered
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃             split-aggr-ordered ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 38.19 / 39.55 ±1.37 / 41.40 ms │ 38.04 / 38.94 ±0.90 / 40.45 ms │ no change │
│ QQuery 2  │ 19.20 / 19.64 ±0.37 / 20.25 ms │ 19.66 / 19.80 ±0.13 / 20.01 ms │ no change │
│ QQuery 3  │ 31.50 / 32.82 ±1.28 / 34.40 ms │ 31.77 / 33.50 ±1.42 / 34.96 ms │ no change │
│ QQuery 4  │ 17.65 / 18.09 ±0.57 / 19.20 ms │ 17.58 / 18.14 ±0.62 / 19.35 ms │ no change │
│ QQuery 5  │ 37.82 / 39.90 ±1.43 / 41.22 ms │ 38.54 / 40.58 ±1.12 / 41.91 ms │ no change │
│ QQuery 6  │ 16.41 / 16.60 ±0.16 / 16.80 ms │ 16.47 / 16.60 ±0.10 / 16.75 ms │ no change │
│ QQuery 7  │ 43.78 / 45.11 ±1.08 / 46.44 ms │ 44.72 / 46.97 ±1.47 / 48.44 ms │ no change │
│ QQuery 8  │ 43.32 / 43.57 ±0.20 / 43.87 ms │ 43.26 / 44.47 ±1.26 / 46.54 ms │ no change │
│ QQuery 9  │ 49.62 / 52.06 ±1.86 / 54.11 ms │ 49.74 / 50.26 ±0.46 / 50.94 ms │ no change │
│ QQuery 10 │ 42.38 / 42.66 ±0.23 / 43.02 ms │ 42.37 / 43.04 ±1.00 / 45.04 ms │ no change │
│ QQuery 11 │ 13.70 / 13.85 ±0.13 / 14.07 ms │ 13.82 / 13.95 ±0.11 / 14.15 ms │ no change │
│ QQuery 12 │ 24.12 / 24.59 ±0.32 / 25.10 ms │ 23.91 / 24.26 ±0.28 / 24.73 ms │ no change │
│ QQuery 13 │ 32.86 / 34.05 ±0.93 / 35.73 ms │ 32.50 / 35.21 ±1.95 / 37.94 ms │ no change │
│ QQuery 14 │ 23.86 / 24.14 ±0.16 / 24.32 ms │ 23.90 / 24.00 ±0.09 / 24.14 ms │ no change │
│ QQuery 15 │ 31.37 / 32.28 ±0.95 / 33.88 ms │ 31.52 / 31.90 ±0.49 / 32.85 ms │ no change │
│ QQuery 16 │ 14.09 / 14.28 ±0.19 / 14.60 ms │ 13.96 / 14.15 ±0.16 / 14.36 ms │ no change │
│ QQuery 17 │ 86.50 / 87.71 ±0.96 / 89.13 ms │ 87.76 / 88.53 ±0.49 / 89.29 ms │ no change │
│ QQuery 18 │ 63.95 / 66.46 ±1.48 / 68.47 ms │ 65.95 / 67.53 ±1.34 / 69.85 ms │ no change │
│ QQuery 19 │ 33.08 / 33.39 ±0.24 / 33.76 ms │ 32.96 / 33.20 ±0.24 / 33.65 ms │ no change │
│ QQuery 20 │ 34.18 / 35.00 ±0.53 / 35.71 ms │ 34.26 / 34.76 ±0.28 / 35.12 ms │ no change │
│ QQuery 21 │ 54.59 / 55.93 ±0.93 / 57.13 ms │ 56.39 / 58.11 ±1.21 / 59.48 ms │ no change │
│ QQuery 22 │ 13.85 / 14.09 ±0.20 / 14.38 ms │ 13.91 / 14.12 ±0.13 / 14.29 ms │ no change │
└───────────┴────────────────────────────────┴────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                 ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                 │ 785.76ms │
│ Total Time (split-aggr-ordered)   │ 792.02ms │
│ Average Time (HEAD)               │  35.72ms │
│ Average Time (split-aggr-ordered) │  36.00ms │
│ Queries Faster                    │        0 │
│ Queries Slower                    │        0 │
│ Queries with No Change            │       22 │
│ Queries with Failure              │        0 │
└───────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 5.0s
Peak memory 1.1 GiB
Avg memory 490.9 MiB
CPU user 23.4s
CPU sys 1.6s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.1 GiB
Avg memory 506.7 MiB
CPU user 23.4s
CPU sys 1.7s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

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

Comparing HEAD and split-aggr-ordered
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃                    split-aggr-ordered ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.64 / 6.08 ±0.79 / 7.65 ms │           5.69 / 6.25 ±0.80 / 7.84 ms │     no change │
│ QQuery 2  │        81.86 / 82.68 ±1.20 / 85.06 ms │        80.86 / 81.28 ±0.32 / 81.60 ms │     no change │
│ QQuery 3  │        32.48 / 33.22 ±0.44 / 33.73 ms │        29.88 / 30.02 ±0.14 / 30.29 ms │ +1.11x faster │
│ QQuery 4  │    490.43 / 515.76 ±30.51 / 567.64 ms │     503.21 / 509.77 ±5.18 / 518.66 ms │     no change │
│ QQuery 5  │        51.49 / 52.45 ±0.70 / 53.46 ms │        52.59 / 52.93 ±0.20 / 53.19 ms │     no change │
│ QQuery 6  │        36.07 / 36.52 ±0.34 / 37.09 ms │        37.18 / 37.37 ±0.15 / 37.55 ms │     no change │
│ QQuery 7  │       94.32 / 96.91 ±4.47 / 105.83 ms │        95.23 / 95.73 ±0.30 / 96.16 ms │     no change │
│ QQuery 8  │        37.02 / 37.63 ±0.61 / 38.65 ms │        37.46 / 37.90 ±0.49 / 38.81 ms │     no change │
│ QQuery 9  │        52.17 / 54.13 ±1.30 / 55.85 ms │        52.70 / 55.15 ±1.36 / 56.54 ms │     no change │
│ QQuery 10 │        63.38 / 63.57 ±0.26 / 64.08 ms │        63.68 / 64.29 ±0.47 / 65.09 ms │     no change │
│ QQuery 11 │     303.97 / 308.30 ±4.11 / 313.50 ms │     318.50 / 323.12 ±3.12 / 327.70 ms │     no change │
│ QQuery 12 │        28.33 / 28.83 ±0.49 / 29.64 ms │        28.98 / 29.65 ±0.38 / 30.14 ms │     no change │
│ QQuery 13 │     118.01 / 119.88 ±1.86 / 123.34 ms │     119.21 / 120.92 ±1.54 / 123.22 ms │     no change │
│ QQuery 14 │     414.34 / 422.11 ±6.14 / 432.85 ms │     421.27 / 423.31 ±3.38 / 430.03 ms │     no change │
│ QQuery 15 │        57.51 / 58.66 ±0.83 / 59.69 ms │        61.03 / 61.42 ±0.34 / 62.01 ms │     no change │
│ QQuery 16 │           6.74 / 6.92 ±0.20 / 7.29 ms │           7.06 / 7.16 ±0.16 / 7.48 ms │     no change │
│ QQuery 17 │        80.19 / 81.60 ±2.03 / 85.58 ms │        82.13 / 84.11 ±2.26 / 87.67 ms │     no change │
│ QQuery 18 │     124.84 / 127.16 ±3.04 / 132.99 ms │     125.23 / 126.84 ±1.24 / 128.84 ms │     no change │
│ QQuery 19 │        41.52 / 41.72 ±0.12 / 41.87 ms │        42.14 / 43.11 ±1.23 / 45.51 ms │     no change │
│ QQuery 20 │        35.61 / 36.99 ±1.73 / 40.30 ms │        36.57 / 37.07 ±0.41 / 37.54 ms │     no change │
│ QQuery 21 │        17.80 / 18.03 ±0.18 / 18.25 ms │        18.09 / 18.14 ±0.03 / 18.16 ms │     no change │
│ QQuery 22 │        62.65 / 63.08 ±0.26 / 63.46 ms │        63.36 / 64.65 ±0.74 / 65.46 ms │     no change │
│ QQuery 23 │     358.16 / 363.25 ±4.26 / 369.11 ms │    367.43 / 380.86 ±21.23 / 423.14 ms │     no change │
│ QQuery 24 │     225.19 / 228.55 ±4.58 / 237.52 ms │     228.46 / 233.79 ±7.93 / 249.44 ms │     no change │
│ QQuery 25 │     110.67 / 111.96 ±1.15 / 113.76 ms │     113.11 / 115.62 ±1.52 / 116.86 ms │     no change │
│ QQuery 26 │        58.84 / 61.43 ±3.15 / 66.89 ms │        58.33 / 58.84 ±0.31 / 59.19 ms │     no change │
│ QQuery 27 │           6.49 / 6.64 ±0.15 / 6.90 ms │           6.57 / 6.70 ±0.11 / 6.91 ms │     no change │
│ QQuery 28 │        61.60 / 62.02 ±0.30 / 62.45 ms │        61.11 / 61.81 ±0.56 / 62.67 ms │     no change │
│ QQuery 29 │      99.16 / 101.64 ±2.44 / 104.90 ms │      98.61 / 101.81 ±3.05 / 106.06 ms │     no change │
│ QQuery 30 │        32.53 / 33.21 ±0.60 / 34.07 ms │        33.12 / 33.24 ±0.08 / 33.37 ms │     no change │
│ QQuery 31 │     111.89 / 112.95 ±0.82 / 114.41 ms │     113.25 / 114.71 ±1.52 / 117.28 ms │     no change │
│ QQuery 32 │        20.82 / 21.10 ±0.19 / 21.39 ms │        21.54 / 21.68 ±0.12 / 21.88 ms │     no change │
│ QQuery 33 │        38.34 / 40.30 ±1.85 / 43.63 ms │        38.69 / 39.14 ±0.44 / 39.78 ms │     no change │
│ QQuery 34 │         9.85 / 10.21 ±0.22 / 10.45 ms │        10.28 / 10.58 ±0.43 / 11.44 ms │     no change │
│ QQuery 35 │        73.17 / 73.93 ±0.52 / 74.70 ms │        74.49 / 75.09 ±0.44 / 75.67 ms │     no change │
│ QQuery 36 │           5.87 / 6.01 ±0.22 / 6.44 ms │           5.92 / 6.09 ±0.18 / 6.44 ms │     no change │
│ QQuery 37 │           7.03 / 7.14 ±0.09 / 7.25 ms │           7.30 / 7.35 ±0.04 / 7.40 ms │     no change │
│ QQuery 38 │        63.46 / 64.22 ±0.57 / 65.19 ms │        64.38 / 66.96 ±2.95 / 72.71 ms │     no change │
│ QQuery 39 │        86.49 / 89.42 ±4.71 / 98.81 ms │        87.23 / 88.06 ±0.78 / 89.36 ms │     no change │
│ QQuery 40 │        23.63 / 23.78 ±0.11 / 23.90 ms │        24.23 / 24.35 ±0.14 / 24.58 ms │     no change │
│ QQuery 41 │        11.49 / 11.73 ±0.25 / 12.21 ms │        12.18 / 12.28 ±0.06 / 12.37 ms │     no change │
│ QQuery 42 │        24.14 / 24.55 ±0.37 / 25.08 ms │        24.32 / 24.62 ±0.21 / 24.96 ms │     no change │
│ QQuery 43 │           4.98 / 5.08 ±0.14 / 5.33 ms │           5.07 / 5.18 ±0.15 / 5.48 ms │     no change │
│ QQuery 44 │           9.47 / 9.63 ±0.13 / 9.79 ms │           9.75 / 9.83 ±0.07 / 9.94 ms │     no change │
│ QQuery 45 │        38.83 / 39.80 ±0.91 / 41.44 ms │        40.66 / 41.61 ±0.52 / 42.17 ms │     no change │
│ QQuery 46 │        11.95 / 12.76 ±0.83 / 14.15 ms │        12.50 / 12.94 ±0.29 / 13.32 ms │     no change │
│ QQuery 47 │     233.55 / 238.81 ±3.36 / 242.31 ms │     243.13 / 245.99 ±3.27 / 252.15 ms │     no change │
│ QQuery 48 │        96.15 / 96.64 ±0.59 / 97.76 ms │       97.01 / 99.11 ±3.50 / 106.10 ms │     no change │
│ QQuery 49 │        75.82 / 78.27 ±1.73 / 80.57 ms │        77.88 / 78.87 ±1.14 / 81.05 ms │     no change │
│ QQuery 50 │        58.72 / 59.31 ±0.33 / 59.61 ms │        59.72 / 59.99 ±0.31 / 60.57 ms │     no change │
│ QQuery 51 │      98.08 / 100.04 ±1.44 / 101.88 ms │      98.60 / 102.73 ±4.51 / 111.17 ms │     no change │
│ QQuery 52 │        24.02 / 26.54 ±2.57 / 30.84 ms │        24.14 / 24.41 ±0.16 / 24.57 ms │ +1.09x faster │
│ QQuery 53 │        29.72 / 30.20 ±0.46 / 30.98 ms │        29.85 / 30.28 ±0.28 / 30.69 ms │     no change │
│ QQuery 54 │        55.60 / 56.11 ±0.43 / 56.72 ms │        56.37 / 56.66 ±0.22 / 56.91 ms │     no change │
│ QQuery 55 │        23.14 / 23.80 ±0.63 / 24.75 ms │        24.16 / 24.40 ±0.16 / 24.65 ms │     no change │
│ QQuery 56 │        38.90 / 39.29 ±0.39 / 40.03 ms │        39.96 / 42.61 ±3.92 / 50.41 ms │  1.08x slower │
│ QQuery 57 │     178.71 / 182.51 ±3.97 / 190.12 ms │     179.95 / 181.91 ±2.07 / 185.88 ms │     no change │
│ QQuery 58 │     116.33 / 117.79 ±1.48 / 120.35 ms │     116.99 / 117.66 ±1.08 / 119.81 ms │     no change │
│ QQuery 59 │     118.74 / 119.43 ±0.41 / 119.91 ms │     118.19 / 120.26 ±1.93 / 123.78 ms │     no change │
│ QQuery 60 │        40.12 / 41.43 ±1.49 / 43.63 ms │        40.29 / 40.53 ±0.24 / 40.97 ms │     no change │
│ QQuery 61 │        12.50 / 12.62 ±0.10 / 12.78 ms │        12.70 / 12.96 ±0.24 / 13.35 ms │     no change │
│ QQuery 62 │        46.89 / 47.17 ±0.14 / 47.30 ms │        46.46 / 46.92 ±0.35 / 47.43 ms │     no change │
│ QQuery 63 │        30.14 / 30.39 ±0.24 / 30.83 ms │        30.00 / 30.33 ±0.30 / 30.85 ms │     no change │
│ QQuery 64 │     415.37 / 421.09 ±6.09 / 430.55 ms │     410.73 / 414.66 ±3.26 / 419.00 ms │     no change │
│ QQuery 65 │     148.46 / 154.65 ±5.56 / 163.42 ms │     151.29 / 155.86 ±4.71 / 164.56 ms │     no change │
│ QQuery 66 │        80.38 / 81.08 ±0.63 / 81.98 ms │        80.59 / 84.12 ±4.19 / 91.10 ms │     no change │
│ QQuery 67 │     245.80 / 255.14 ±7.80 / 264.99 ms │     246.76 / 253.52 ±6.13 / 264.88 ms │     no change │
│ QQuery 68 │        12.00 / 12.54 ±0.39 / 13.17 ms │        12.16 / 12.40 ±0.17 / 12.67 ms │     no change │
│ QQuery 69 │        58.00 / 58.58 ±0.44 / 59.00 ms │        57.77 / 58.47 ±0.51 / 59.27 ms │     no change │
│ QQuery 70 │     106.07 / 108.11 ±2.54 / 113.08 ms │     105.16 / 112.04 ±9.25 / 130.18 ms │     no change │
│ QQuery 71 │        36.29 / 39.69 ±5.45 / 50.55 ms │        35.43 / 36.42 ±0.73 / 37.69 ms │ +1.09x faster │
│ QQuery 72 │ 2170.39 / 2236.90 ±48.29 / 2294.09 ms │ 2180.51 / 2244.02 ±40.23 / 2296.20 ms │     no change │
│ QQuery 73 │         9.88 / 10.13 ±0.19 / 10.47 ms │          9.62 / 9.81 ±0.25 / 10.31 ms │     no change │
│ QQuery 74 │     175.44 / 180.27 ±4.16 / 187.68 ms │     170.29 / 176.27 ±3.11 / 178.84 ms │     no change │
│ QQuery 75 │     151.71 / 152.33 ±0.58 / 153.42 ms │     152.04 / 157.03 ±8.32 / 173.64 ms │     no change │
│ QQuery 76 │        36.55 / 39.50 ±4.21 / 47.83 ms │        36.14 / 36.60 ±0.43 / 37.17 ms │ +1.08x faster │
│ QQuery 77 │        61.52 / 62.29 ±0.61 / 63.36 ms │        62.53 / 62.88 ±0.35 / 63.41 ms │     no change │
│ QQuery 78 │     186.05 / 190.80 ±3.18 / 194.63 ms │     187.55 / 192.41 ±5.33 / 202.71 ms │     no change │
│ QQuery 79 │        67.97 / 68.25 ±0.22 / 68.64 ms │        67.87 / 68.79 ±0.71 / 69.64 ms │     no change │
│ QQuery 80 │      99.78 / 101.72 ±2.75 / 107.15 ms │      99.89 / 100.91 ±1.70 / 104.31 ms │     no change │
│ QQuery 81 │        25.96 / 26.36 ±0.31 / 26.64 ms │        26.71 / 26.84 ±0.12 / 27.00 ms │     no change │
│ QQuery 82 │        16.95 / 17.04 ±0.07 / 17.15 ms │        16.74 / 17.06 ±0.28 / 17.47 ms │     no change │
│ QQuery 83 │        41.12 / 41.32 ±0.17 / 41.62 ms │        41.03 / 45.41 ±6.24 / 57.60 ms │  1.10x slower │
│ QQuery 84 │        30.71 / 31.17 ±0.24 / 31.36 ms │        30.89 / 31.52 ±0.50 / 32.34 ms │     no change │
│ QQuery 85 │     106.78 / 111.11 ±5.38 / 121.63 ms │     108.87 / 109.36 ±0.42 / 110.01 ms │     no change │
│ QQuery 86 │        25.49 / 25.98 ±0.26 / 26.20 ms │        25.86 / 26.13 ±0.18 / 26.40 ms │     no change │
│ QQuery 87 │        64.38 / 65.18 ±0.66 / 66.21 ms │        65.15 / 67.98 ±3.06 / 73.33 ms │     no change │
│ QQuery 88 │        63.93 / 64.97 ±1.52 / 67.97 ms │        64.09 / 64.81 ±0.37 / 65.09 ms │     no change │
│ QQuery 89 │        36.22 / 36.68 ±0.43 / 37.31 ms │        36.46 / 37.03 ±0.62 / 37.95 ms │     no change │
│ QQuery 90 │        17.54 / 17.64 ±0.06 / 17.72 ms │        17.91 / 17.98 ±0.10 / 18.15 ms │     no change │
│ QQuery 91 │        46.14 / 46.58 ±0.36 / 47.10 ms │        46.42 / 48.30 ±2.51 / 53.22 ms │     no change │
│ QQuery 92 │        30.00 / 30.49 ±0.41 / 31.13 ms │        30.69 / 31.54 ±0.61 / 32.59 ms │     no change │
│ QQuery 93 │        50.50 / 51.23 ±0.61 / 52.33 ms │        50.91 / 51.44 ±0.47 / 52.09 ms │     no change │
│ QQuery 94 │        38.74 / 38.97 ±0.21 / 39.37 ms │        38.81 / 39.47 ±0.52 / 40.35 ms │     no change │
│ QQuery 95 │        82.01 / 83.02 ±0.90 / 84.40 ms │        84.19 / 86.03 ±3.35 / 92.72 ms │     no change │
│ QQuery 96 │        25.03 / 25.21 ±0.15 / 25.44 ms │        24.97 / 25.22 ±0.23 / 25.62 ms │     no change │
│ QQuery 97 │        55.53 / 57.61 ±2.33 / 62.09 ms │        55.44 / 55.96 ±0.47 / 56.85 ms │     no change │
│ QQuery 98 │        43.53 / 44.27 ±0.69 / 45.11 ms │        43.60 / 43.76 ±0.13 / 43.90 ms │     no change │
│ QQuery 99 │        70.95 / 71.40 ±0.27 / 71.62 ms │        70.97 / 73.93 ±4.67 / 83.23 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                 ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                 │ 10173.19ms │
│ Total Time (split-aggr-ordered)   │ 10254.91ms │
│ Average Time (HEAD)               │   102.76ms │
│ Average Time (split-aggr-ordered) │   103.58ms │
│ Queries Faster                    │          4 │
│ Queries Slower                    │          2 │
│ Queries with No Change            │         93 │
│ Queries with Failure              │          0 │
└───────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 55.0s
Peak memory 2.1 GiB
Avg memory 1.4 GiB
CPU user 234.8s
CPU sys 5.8s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 2.0 GiB
Avg memory 1.4 GiB
CPU user 231.6s
CPU sys 6.0s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

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

Comparing HEAD and split-aggr-ordered
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                       HEAD ┃                         split-aggr-ordered ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │               1.26 / 4.05 ±5.47 / 14.99 ms │               1.27 / 4.15 ±5.61 / 15.38 ms │     no change │
│ QQuery 1  │             13.26 / 13.87 ±0.46 / 14.37 ms │             12.84 / 12.96 ±0.11 / 13.14 ms │ +1.07x faster │
│ QQuery 2  │             36.86 / 37.12 ±0.26 / 37.60 ms │             36.02 / 36.25 ±0.20 / 36.56 ms │     no change │
│ QQuery 3  │             32.61 / 33.10 ±0.74 / 34.55 ms │             30.85 / 31.28 ±0.45 / 31.85 ms │ +1.06x faster │
│ QQuery 4  │      1741.89 / 1807.97 ±55.81 / 1909.06 ms │      1673.16 / 1720.90 ±52.05 / 1817.54 ms │     no change │
│ QQuery 5  │      1652.57 / 1738.58 ±60.96 / 1843.59 ms │     1658.67 / 1777.76 ±212.30 / 2201.93 ms │     no change │
│ QQuery 6  │                1.30 / 1.44 ±0.23 / 1.90 ms │                1.27 / 1.42 ±0.24 / 1.89 ms │     no change │
│ QQuery 7  │             14.42 / 14.57 ±0.09 / 14.67 ms │             13.71 / 13.91 ±0.16 / 14.19 ms │     no change │
│ QQuery 8  │      1977.08 / 2108.85 ±88.60 / 2253.84 ms │      2115.79 / 2231.80 ±96.31 / 2395.66 ms │  1.06x slower │
│ QQuery 9  │         525.11 / 568.12 ±29.72 / 599.44 ms │         481.98 / 511.64 ±27.02 / 561.88 ms │ +1.11x faster │
│ QQuery 10 │           77.79 / 94.31 ±17.74 / 125.99 ms │           78.98 / 91.63 ±17.72 / 126.82 ms │     no change │
│ QQuery 11 │           97.88 / 104.94 ±5.15 / 111.97 ms │             89.69 / 92.36 ±2.48 / 95.60 ms │ +1.14x faster │
│ QQuery 12 │     1804.91 / 2000.05 ±173.74 / 2297.21 ms │      1623.79 / 1766.16 ±97.82 / 1879.10 ms │ +1.13x faster │
│ QQuery 13 │        567.07 / 703.94 ±102.06 / 829.61 ms │        505.24 / 681.94 ±142.73 / 904.61 ms │     no change │
│ QQuery 14 │         536.08 / 573.61 ±29.37 / 613.79 ms │         536.85 / 553.37 ±12.82 / 568.21 ms │     no change │
│ QQuery 15 │      1930.30 / 2007.33 ±51.03 / 2075.19 ms │      1885.33 / 1950.52 ±50.65 / 2014.94 ms │     no change │
│ QQuery 16 │     4406.20 / 4577.07 ±153.57 / 4771.85 ms │      4397.17 / 4479.02 ±87.57 / 4639.05 ms │     no change │
│ QQuery 17 │     4392.38 / 4544.83 ±108.12 / 4676.85 ms │     4172.30 / 4415.04 ±181.53 / 4712.24 ms │     no change │
│ QQuery 18 │  18888.92 / 19244.37 ±404.18 / 20033.56 ms │  18380.02 / 18991.44 ±546.38 / 19746.57 ms │     no change │
│ QQuery 19 │             27.79 / 32.86 ±8.94 / 50.71 ms │             28.02 / 28.83 ±1.15 / 31.12 ms │ +1.14x faster │
│ QQuery 20 │          525.10 / 534.50 ±8.54 / 549.14 ms │          516.35 / 525.63 ±7.44 / 536.95 ms │     no change │
│ QQuery 21 │          528.99 / 537.89 ±4.93 / 542.55 ms │          511.70 / 521.37 ±6.46 / 529.74 ms │     no change │
│ QQuery 22 │        993.40 / 1000.27 ±9.01 / 1018.08 ms │      1002.22 / 1037.36 ±25.86 / 1068.14 ms │     no change │
│ QQuery 23 │     3073.25 / 3278.12 ±130.10 / 3452.78 ms │      3060.76 / 3142.25 ±50.24 / 3208.65 ms │     no change │
│ QQuery 24 │            41.88 / 51.88 ±12.05 / 71.88 ms │             41.30 / 42.26 ±0.96 / 44.01 ms │ +1.23x faster │
│ QQuery 25 │         111.84 / 121.99 ±12.15 / 142.77 ms │          111.28 / 116.32 ±5.81 / 126.99 ms │     no change │
│ QQuery 26 │             41.94 / 42.67 ±0.71 / 43.91 ms │             41.89 / 46.12 ±5.20 / 54.32 ms │  1.08x slower │
│ QQuery 27 │         681.76 / 697.43 ±16.39 / 729.18 ms │          668.79 / 680.15 ±6.94 / 687.61 ms │     no change │
│ QQuery 28 │     3469.45 / 3678.72 ±142.15 / 3882.11 ms │     3545.09 / 3661.78 ±123.27 / 3865.77 ms │     no change │
│ QQuery 29 │             40.84 / 41.27 ±0.38 / 41.90 ms │           40.96 / 57.70 ±25.45 / 107.01 ms │  1.40x slower │
│ QQuery 30 │         608.76 / 626.14 ±11.38 / 642.45 ms │         621.13 / 661.43 ±21.29 / 683.55 ms │  1.06x slower │
│ QQuery 31 │         296.78 / 308.18 ±11.33 / 327.20 ms │         306.14 / 351.30 ±43.31 / 425.05 ms │  1.14x slower │
│ QQuery 32 │       964.97 / 1011.40 ±26.24 / 1044.80 ms │      972.66 / 1096.61 ±100.44 / 1230.76 ms │  1.08x slower │
│ QQuery 33 │  30789.35 / 31525.90 ±468.98 / 32096.31 ms │ 29659.80 / 31463.43 ±1881.05 / 34307.66 ms │     no change │
│ QQuery 34 │ 28187.53 / 30666.60 ±2086.24 / 33684.51 ms │ 27063.69 / 30382.07 ±2523.44 / 34860.13 ms │     no change │
│ QQuery 35 │      1115.55 / 1166.18 ±87.35 / 1340.44 ms │     1076.08 / 1172.90 ±144.96 / 1460.74 ms │     no change │
│ QQuery 36 │          157.94 / 169.41 ±6.91 / 178.65 ms │          162.48 / 169.01 ±5.79 / 179.80 ms │     no change │
│ QQuery 37 │           37.52 / 54.61 ±31.49 / 117.56 ms │           37.67 / 55.76 ±31.50 / 118.69 ms │     no change │
│ QQuery 38 │             42.81 / 44.84 ±1.74 / 47.18 ms │             43.38 / 45.43 ±1.03 / 46.05 ms │     no change │
│ QQuery 39 │         166.11 / 193.96 ±19.12 / 225.14 ms │         175.61 / 202.95 ±25.00 / 245.20 ms │     no change │
│ QQuery 40 │             14.95 / 15.13 ±0.13 / 15.31 ms │             16.43 / 17.46 ±0.65 / 18.45 ms │  1.15x slower │
│ QQuery 41 │             13.99 / 14.23 ±0.15 / 14.44 ms │             14.29 / 17.06 ±3.61 / 24.13 ms │  1.20x slower │
│ QQuery 42 │             13.77 / 13.98 ±0.16 / 14.16 ms │             13.82 / 14.05 ±0.18 / 14.28 ms │     no change │
└───────────┴────────────────────────────────────────────┴────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Benchmark Summary                 ┃             ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ Total Time (HEAD)                 │ 116006.31ms │
│ Total Time (split-aggr-ordered)   │ 114872.76ms │
│ Average Time (HEAD)               │   2697.82ms │
│ Average Time (split-aggr-ordered) │   2671.46ms │
│ Queries Faster                    │           7 │
│ Queries Slower                    │           8 │
│ Queries with No Change            │          28 │
│ Queries with Failure              │           0 │
└───────────────────────────────────┴─────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 585.1s
Peak memory 12.1 GiB
Avg memory 6.5 GiB
CPU user 5119.8s
CPU sys 350.8s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 575.1s
Peak memory 12.2 GiB
Avg memory 6.6 GiB
CPU user 5159.6s
CPU sys 358.4s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

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

Comparing HEAD and split-aggr-ordered
--------------------
Benchmark clickbench_sorted.json
--------------------
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query    ┃                              HEAD ┃                split-aggr-ordered ┃        Change ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0 │ 79.24 / 151.48 ±71.74 / 280.56 ms │ 79.12 / 101.71 ±28.02 / 153.78 ms │ +1.49x faster │
└──────────┴───────────────────────────────────┴───────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                 ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                 │ 151.48ms │
│ Total Time (split-aggr-ordered)   │ 101.71ms │
│ Average Time (HEAD)               │ 151.48ms │
│ Average Time (split-aggr-ordered) │ 101.71ms │
│ Queries Faster                    │        1 │
│ Queries Slower                    │        0 │
│ Queries with No Change            │        0 │
│ Queries with Failure              │        0 │
└───────────────────────────────────┴──────────┘

Resource Usage

clickbench_sorted — base (merge-base)

Metric Value
Wall time 5.0s
Peak memory 280.6 MiB
Avg memory 46.8 MiB
CPU user 0.0s
CPU sys 0.0s
Peak spill 0 B

clickbench_sorted — branch

Metric Value
Wall time 5.0s
Peak memory 1.7 GiB
Avg memory 290.0 MiB
CPU user 0.0s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

fix: respect batch size in ordered aggregates
@2010YOUY01

Copy link
Copy Markdown
Contributor Author

Thank you for the review, @alamb. The suggestions make sense to me, and I’ll try to address them later (likely tomorrow).

Longer term it would be nice to have some way to reduce the duplication (I realize some in inevitable, but there is a lot I think that is unecessary)

I’m also quite tempted to reuse code here. For example, the partial-reduce variant could probably be implemented by adding a few flags to the existing partial aggregation path.

My main concern is that these paths may evolve into very different shapes in the future, due to optimizations specialized for each case. I want to keep that future evolution easy.

One example is the ordered aggregation variant. For the fully ordered case, I realized we may not need a hash table at all. We could likely make it faster by finding the group split points first and then aggregating each group directly.

So as a middle ground, I think we should:

  • Keep the execution paths (streams) separate when their semantics are different.
  • Extract common utility functions for code that is almost identical. If the paths need to evolve differently later, we can then stop sharing those utilities.

@alamb

alamb commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
  • Keep the execution paths (streams) separate when their semantics are different.
  • Extract common utility functions for code that is almost identical. If the paths need to evolve differently later, we can then stop sharing those utilities.

Sounds like a greaet plan to me

@alamb

alamb commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Shall we merge?

@2010YOUY01 2010YOUY01 added this pull request to the merge queue Jul 3, 2026
Merged via the queue into apache:main with commit aadbd1c Jul 3, 2026
38 checks passed
@2010YOUY01 2010YOUY01 deleted the split-aggr-ordered branch July 3, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants