Skip to content

refactor(hash-aggr): Simplify aggregate hash table with tempated functions#23324

Open
2010YOUY01 wants to merge 2 commits into
apache:mainfrom
2010YOUY01:split-aggr-simplify-ht-template
Open

refactor(hash-aggr): Simplify aggregate hash table with tempated functions#23324
2010YOUY01 wants to merge 2 commits into
apache:mainfrom
2010YOUY01:split-aggr-simplify-ht-template

Conversation

@2010YOUY01

@2010YOUY01 2010YOUY01 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

See #23309 and #23309 (comment) for background.

I prefer this approach, but I want to point out the tradeoff for this PR's approach: the shared utility includes a complex lambda function argument, this makes them harder to extend. But I think it's okay since most functionality has been implemented for the refactor, and there are not likely to have new functional requirements.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@2010YOUY01 2010YOUY01 requested a review from alamb July 5, 2026 02:23
@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Jul 5, 2026
@2010YOUY01 2010YOUY01 requested a review from Rachelint July 5, 2026 02:24
@Rachelint

Copy link
Copy Markdown
Contributor

run benchmarks

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4898755907-881-4nqj4 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-simplify-ht-template (a1c9b6a) to 166c040 (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-c4898755907-880-pd2sv 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-simplify-ht-template (a1c9b6a) to 166c040 (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-c4898755907-879-6j9lb 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-simplify-ht-template (a1c9b6a) to 166c040 (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete


File an issue against this benchmark runner

@Rachelint Rachelint 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.

Thanks @2010YOUY01 , It seems actually clear after removing duplication through this approach

@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-simplify-ht-template
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃ split-aggr-simplify-ht-template ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 37.98 / 38.84 ±0.98 / 40.71 ms │  38.06 / 38.90 ±0.95 / 40.62 ms │ no change │
│ QQuery 2  │ 19.30 / 19.89 ±0.78 / 21.41 ms │  19.15 / 19.49 ±0.36 / 20.19 ms │ no change │
│ QQuery 3  │ 30.99 / 32.37 ±0.98 / 33.46 ms │  30.48 / 32.49 ±1.32 / 33.63 ms │ no change │
│ QQuery 4  │ 17.73 / 18.37 ±0.57 / 19.12 ms │  17.48 / 17.75 ±0.37 / 18.49 ms │ no change │
│ QQuery 5  │ 37.75 / 40.22 ±2.26 / 43.88 ms │  37.99 / 39.56 ±1.36 / 41.40 ms │ no change │
│ QQuery 6  │ 16.13 / 16.19 ±0.06 / 16.30 ms │  16.21 / 16.38 ±0.14 / 16.56 ms │ no change │
│ QQuery 7  │ 44.59 / 45.73 ±0.84 / 47.16 ms │  43.79 / 45.26 ±0.94 / 46.30 ms │ no change │
│ QQuery 8  │ 43.41 / 43.91 ±0.77 / 45.43 ms │  43.47 / 43.74 ±0.21 / 43.99 ms │ no change │
│ QQuery 9  │ 49.23 / 50.38 ±1.09 / 52.21 ms │  49.70 / 50.24 ±0.53 / 50.88 ms │ no change │
│ QQuery 10 │ 42.48 / 43.23 ±0.98 / 45.08 ms │  42.28 / 42.55 ±0.16 / 42.73 ms │ no change │
│ QQuery 11 │ 13.36 / 13.58 ±0.21 / 13.97 ms │  13.55 / 13.71 ±0.11 / 13.84 ms │ no change │
│ QQuery 12 │ 24.16 / 24.80 ±0.81 / 26.38 ms │  23.88 / 25.02 ±1.33 / 27.56 ms │ no change │
│ QQuery 13 │ 32.24 / 34.24 ±1.62 / 36.37 ms │  31.99 / 34.94 ±3.24 / 41.20 ms │ no change │
│ QQuery 14 │ 23.72 / 24.03 ±0.42 / 24.84 ms │  23.85 / 24.11 ±0.15 / 24.29 ms │ no change │
│ QQuery 15 │ 30.96 / 31.33 ±0.36 / 32.00 ms │  31.24 / 31.78 ±0.61 / 32.95 ms │ no change │
│ QQuery 16 │ 13.79 / 14.18 ±0.34 / 14.71 ms │  14.27 / 14.43 ±0.20 / 14.79 ms │ no change │
│ QQuery 17 │ 73.23 / 74.15 ±0.84 / 75.65 ms │  74.08 / 74.55 ±0.29 / 74.78 ms │ no change │
│ QQuery 18 │ 57.86 / 60.32 ±1.91 / 62.73 ms │  58.26 / 60.90 ±1.50 / 62.29 ms │ no change │
│ QQuery 19 │ 32.74 / 33.27 ±0.33 / 33.71 ms │  33.01 / 33.28 ±0.30 / 33.84 ms │ no change │
│ QQuery 20 │ 31.73 / 32.56 ±0.66 / 33.68 ms │  31.93 / 32.37 ±0.30 / 32.84 ms │ no change │
│ QQuery 21 │ 55.54 / 56.30 ±0.48 / 56.80 ms │  54.29 / 56.73 ±1.45 / 58.31 ms │ no change │
│ QQuery 22 │ 13.81 / 14.03 ±0.23 / 14.46 ms │  14.05 / 14.54 ±0.49 / 15.43 ms │ no change │
└───────────┴────────────────────────────────┴─────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                              ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                              │ 761.91ms │
│ Total Time (split-aggr-simplify-ht-template)   │ 762.72ms │
│ Average Time (HEAD)                            │  34.63ms │
│ Average Time (split-aggr-simplify-ht-template) │  34.67ms │
│ 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.2 GiB
Avg memory 506.3 MiB
CPU user 22.0s
CPU sys 1.6s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.1 GiB
Avg memory 508.5 MiB
CPU user 22.1s
CPU sys 1.6s
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-simplify-ht-template
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃       split-aggr-simplify-ht-template ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.66 / 6.16 ±0.81 / 7.77 ms │           5.64 / 6.20 ±0.80 / 7.79 ms │     no change │
│ QQuery 2  │        81.15 / 81.56 ±0.40 / 82.32 ms │        80.80 / 81.26 ±0.39 / 81.82 ms │     no change │
│ QQuery 3  │        29.90 / 30.00 ±0.09 / 30.18 ms │        29.79 / 30.08 ±0.21 / 30.42 ms │     no change │
│ QQuery 4  │     506.44 / 510.51 ±2.67 / 513.92 ms │    503.50 / 540.97 ±40.06 / 596.22 ms │  1.06x slower │
│ QQuery 5  │        52.15 / 52.60 ±0.44 / 53.23 ms │        52.38 / 54.07 ±1.91 / 57.50 ms │     no change │
│ QQuery 6  │        37.16 / 37.54 ±0.22 / 37.76 ms │        38.89 / 40.04 ±0.73 / 40.87 ms │  1.07x slower │
│ QQuery 7  │        93.99 / 95.43 ±1.88 / 99.10 ms │        94.95 / 95.96 ±0.71 / 97.17 ms │     no change │
│ QQuery 8  │        37.32 / 37.77 ±0.55 / 38.86 ms │        37.24 / 37.76 ±0.40 / 38.30 ms │     no change │
│ QQuery 9  │        53.28 / 55.56 ±1.92 / 58.89 ms │        52.07 / 54.74 ±1.97 / 57.59 ms │     no change │
│ QQuery 10 │        64.21 / 64.36 ±0.14 / 64.61 ms │        63.27 / 65.31 ±2.63 / 70.48 ms │     no change │
│ QQuery 11 │     314.16 / 318.02 ±2.87 / 322.89 ms │     314.20 / 321.25 ±7.77 / 333.94 ms │     no change │
│ QQuery 12 │        28.93 / 29.34 ±0.38 / 29.95 ms │        29.13 / 29.40 ±0.20 / 29.65 ms │     no change │
│ QQuery 13 │     118.41 / 119.65 ±0.96 / 120.85 ms │     118.07 / 121.34 ±3.91 / 129.04 ms │     no change │
│ QQuery 14 │     417.90 / 424.08 ±4.85 / 430.55 ms │     420.13 / 424.58 ±2.81 / 428.94 ms │     no change │
│ QQuery 15 │        59.18 / 59.71 ±0.63 / 60.82 ms │        59.81 / 60.73 ±0.88 / 62.30 ms │     no change │
│ QQuery 16 │           6.94 / 7.04 ±0.13 / 7.29 ms │           6.91 / 7.12 ±0.19 / 7.42 ms │     no change │
│ QQuery 17 │        82.14 / 83.38 ±1.71 / 86.74 ms │        81.50 / 83.40 ±2.41 / 88.14 ms │     no change │
│ QQuery 18 │     125.79 / 126.75 ±0.78 / 128.11 ms │     124.62 / 125.94 ±0.84 / 127.16 ms │     no change │
│ QQuery 19 │        41.70 / 42.07 ±0.32 / 42.46 ms │        42.06 / 43.53 ±2.22 / 47.93 ms │     no change │
│ QQuery 20 │        37.13 / 38.23 ±0.79 / 39.40 ms │        37.27 / 37.76 ±0.28 / 38.12 ms │     no change │
│ QQuery 21 │        18.11 / 18.21 ±0.09 / 18.33 ms │        18.03 / 18.32 ±0.30 / 18.80 ms │     no change │
│ QQuery 22 │        63.75 / 64.57 ±0.51 / 65.32 ms │        63.80 / 64.87 ±0.95 / 66.59 ms │     no change │
│ QQuery 23 │     352.85 / 358.69 ±5.32 / 368.21 ms │     352.29 / 356.60 ±3.35 / 360.75 ms │     no change │
│ QQuery 24 │     229.29 / 237.37 ±7.09 / 245.93 ms │     229.10 / 232.29 ±3.26 / 238.32 ms │     no change │
│ QQuery 25 │     119.92 / 121.73 ±1.72 / 124.33 ms │     111.66 / 114.29 ±2.14 / 117.25 ms │ +1.07x faster │
│ QQuery 26 │        62.15 / 62.52 ±0.24 / 62.83 ms │        58.55 / 59.17 ±0.53 / 59.81 ms │ +1.06x faster │
│ QQuery 27 │           7.35 / 7.40 ±0.03 / 7.43 ms │           6.40 / 6.63 ±0.16 / 6.88 ms │ +1.12x faster │
│ QQuery 28 │        59.55 / 62.69 ±2.51 / 64.97 ms │        58.00 / 60.58 ±1.42 / 62.34 ms │     no change │
│ QQuery 29 │     105.57 / 108.19 ±2.05 / 110.88 ms │      98.69 / 100.98 ±1.78 / 104.09 ms │ +1.07x faster │
│ QQuery 30 │        35.67 / 36.62 ±0.69 / 37.30 ms │        32.74 / 33.19 ±0.44 / 33.96 ms │ +1.10x faster │
│ QQuery 31 │     120.59 / 122.65 ±2.52 / 126.79 ms │     112.46 / 113.40 ±0.78 / 114.46 ms │ +1.08x faster │
│ QQuery 32 │        23.17 / 23.36 ±0.22 / 23.68 ms │        20.96 / 22.32 ±1.97 / 26.22 ms │     no change │
│ QQuery 33 │        41.11 / 41.50 ±0.29 / 42.00 ms │        38.29 / 38.67 ±0.28 / 39.16 ms │ +1.07x faster │
│ QQuery 34 │        11.02 / 11.52 ±0.42 / 12.04 ms │         9.88 / 10.08 ±0.11 / 10.23 ms │ +1.14x faster │
│ QQuery 35 │        83.16 / 83.50 ±0.37 / 84.22 ms │        73.38 / 74.34 ±0.68 / 75.49 ms │ +1.12x faster │
│ QQuery 36 │           6.70 / 6.85 ±0.11 / 7.04 ms │           6.02 / 6.19 ±0.17 / 6.52 ms │ +1.11x faster │
│ QQuery 37 │           7.78 / 7.96 ±0.15 / 8.18 ms │           7.28 / 7.35 ±0.04 / 7.38 ms │ +1.08x faster │
│ QQuery 38 │        71.10 / 72.87 ±1.81 / 76.30 ms │        64.21 / 65.42 ±1.14 / 67.36 ms │ +1.11x faster │
│ QQuery 39 │     103.73 / 106.94 ±2.79 / 111.99 ms │        92.00 / 93.14 ±0.96 / 94.36 ms │ +1.15x faster │
│ QQuery 40 │        26.02 / 27.08 ±1.55 / 30.16 ms │        24.07 / 24.32 ±0.22 / 24.65 ms │ +1.11x faster │
│ QQuery 41 │        12.96 / 13.27 ±0.38 / 14.01 ms │        11.93 / 12.25 ±0.21 / 12.58 ms │ +1.08x faster │
│ QQuery 42 │        25.65 / 26.21 ±0.49 / 26.88 ms │        23.91 / 24.50 ±0.57 / 25.51 ms │ +1.07x faster │
│ QQuery 43 │           5.71 / 5.78 ±0.06 / 5.86 ms │           5.07 / 5.22 ±0.16 / 5.54 ms │ +1.11x faster │
│ QQuery 44 │        10.67 / 10.75 ±0.07 / 10.85 ms │         9.69 / 10.95 ±2.19 / 15.33 ms │     no change │
│ QQuery 45 │        50.45 / 52.42 ±1.17 / 53.80 ms │        38.67 / 40.83 ±1.56 / 42.82 ms │ +1.28x faster │
│ QQuery 46 │        13.13 / 13.52 ±0.29 / 13.92 ms │        12.29 / 12.55 ±0.21 / 12.90 ms │ +1.08x faster │
│ QQuery 47 │    234.66 / 255.50 ±16.49 / 285.16 ms │    236.90 / 264.14 ±22.52 / 288.19 ms │     no change │
│ QQuery 48 │       96.96 / 99.50 ±3.61 / 106.61 ms │     101.93 / 103.55 ±1.10 / 105.13 ms │     no change │
│ QQuery 49 │        76.65 / 77.45 ±0.61 / 78.47 ms │        82.42 / 83.61 ±0.81 / 84.53 ms │  1.08x slower │
│ QQuery 50 │        59.91 / 60.49 ±0.84 / 62.13 ms │        63.37 / 63.63 ±0.14 / 63.77 ms │  1.05x slower │
│ QQuery 51 │        91.75 / 94.31 ±2.05 / 97.01 ms │       96.58 / 99.51 ±1.88 / 101.99 ms │  1.06x slower │
│ QQuery 52 │        24.22 / 24.50 ±0.16 / 24.69 ms │        25.93 / 26.23 ±0.27 / 26.59 ms │  1.07x slower │
│ QQuery 53 │        29.94 / 30.13 ±0.14 / 30.27 ms │        31.87 / 32.11 ±0.19 / 32.40 ms │  1.07x slower │
│ QQuery 54 │        56.57 / 59.64 ±4.21 / 67.68 ms │        59.89 / 60.20 ±0.26 / 60.56 ms │     no change │
│ QQuery 55 │        23.78 / 24.50 ±0.71 / 25.51 ms │        25.35 / 25.71 ±0.20 / 25.88 ms │     no change │
│ QQuery 56 │        39.39 / 40.07 ±0.55 / 40.81 ms │        42.74 / 43.35 ±0.52 / 44.25 ms │  1.08x slower │
│ QQuery 57 │     177.87 / 180.65 ±3.77 / 188.04 ms │     192.79 / 194.88 ±2.00 / 198.41 ms │  1.08x slower │
│ QQuery 58 │     116.74 / 118.11 ±1.31 / 119.67 ms │     124.40 / 125.38 ±0.53 / 125.85 ms │  1.06x slower │
│ QQuery 59 │     118.10 / 120.34 ±1.85 / 123.51 ms │     123.88 / 126.25 ±4.07 / 134.38 ms │     no change │
│ QQuery 60 │        40.19 / 40.91 ±1.05 / 42.96 ms │        42.27 / 43.62 ±1.58 / 46.58 ms │  1.07x slower │
│ QQuery 61 │        12.62 / 12.76 ±0.12 / 12.97 ms │        13.21 / 13.71 ±0.51 / 14.40 ms │  1.07x slower │
│ QQuery 62 │        46.53 / 48.15 ±2.52 / 53.15 ms │        46.65 / 47.26 ±0.79 / 48.79 ms │     no change │
│ QQuery 63 │        30.01 / 30.80 ±1.10 / 32.97 ms │        29.87 / 30.81 ±0.61 / 31.59 ms │     no change │
│ QQuery 64 │    418.01 / 429.76 ±11.80 / 448.89 ms │     412.86 / 420.20 ±4.67 / 426.13 ms │     no change │
│ QQuery 65 │     158.35 / 159.90 ±0.89 / 160.74 ms │     149.86 / 151.40 ±1.34 / 153.77 ms │ +1.06x faster │
│ QQuery 66 │        80.36 / 82.87 ±2.23 / 86.18 ms │        80.60 / 84.06 ±4.44 / 92.81 ms │     no change │
│ QQuery 67 │     251.75 / 260.83 ±8.33 / 275.44 ms │     249.79 / 255.91 ±3.99 / 260.83 ms │     no change │
│ QQuery 68 │        12.16 / 12.55 ±0.36 / 13.23 ms │        12.35 / 12.50 ±0.08 / 12.56 ms │     no change │
│ QQuery 69 │        58.21 / 59.03 ±1.20 / 61.40 ms │        58.31 / 59.51 ±1.19 / 61.65 ms │     no change │
│ QQuery 70 │     106.05 / 108.83 ±3.76 / 116.10 ms │     107.18 / 113.69 ±9.74 / 132.85 ms │     no change │
│ QQuery 71 │        36.22 / 36.53 ±0.22 / 36.81 ms │        35.59 / 36.05 ±0.26 / 36.34 ms │     no change │
│ QQuery 72 │ 2144.93 / 2247.81 ±54.29 / 2299.11 ms │ 2244.92 / 2355.39 ±95.75 / 2483.87 ms │     no change │
│ QQuery 73 │        10.43 / 10.77 ±0.24 / 11.15 ms │         9.95 / 10.18 ±0.20 / 10.42 ms │ +1.06x faster │
│ QQuery 74 │     180.83 / 189.80 ±8.99 / 201.27 ms │     177.08 / 183.61 ±6.78 / 196.58 ms │     no change │
│ QQuery 75 │     151.66 / 156.11 ±2.26 / 157.79 ms │     152.49 / 153.77 ±1.20 / 155.37 ms │     no change │
│ QQuery 76 │        35.99 / 39.53 ±4.19 / 46.73 ms │        35.95 / 36.35 ±0.26 / 36.62 ms │ +1.09x faster │
│ QQuery 77 │        62.18 / 63.19 ±0.94 / 64.44 ms │        62.74 / 63.12 ±0.40 / 63.78 ms │     no change │
│ QQuery 78 │     200.65 / 203.82 ±2.06 / 206.94 ms │     198.14 / 202.31 ±3.17 / 206.09 ms │     no change │
│ QQuery 79 │        67.33 / 68.12 ±0.47 / 68.61 ms │        69.02 / 76.15 ±7.10 / 88.93 ms │  1.12x slower │
│ QQuery 80 │     101.15 / 106.20 ±8.88 / 123.92 ms │     108.30 / 110.85 ±2.44 / 115.44 ms │     no change │
│ QQuery 81 │        26.55 / 27.07 ±0.61 / 28.22 ms │        28.39 / 28.95 ±0.48 / 29.64 ms │  1.07x slower │
│ QQuery 82 │        17.28 / 17.38 ±0.10 / 17.54 ms │        17.61 / 18.19 ±0.35 / 18.71 ms │     no change │
│ QQuery 83 │        41.87 / 42.19 ±0.27 / 42.58 ms │        41.70 / 46.88 ±6.34 / 59.08 ms │  1.11x slower │
│ QQuery 84 │        31.33 / 31.55 ±0.16 / 31.79 ms │        32.13 / 32.61 ±0.43 / 33.37 ms │     no change │
│ QQuery 85 │     107.82 / 114.62 ±8.61 / 131.42 ms │     111.21 / 111.96 ±1.24 / 114.42 ms │     no change │
│ QQuery 86 │        25.85 / 26.10 ±0.24 / 26.43 ms │        27.24 / 28.41 ±2.06 / 32.51 ms │  1.09x slower │
│ QQuery 87 │        63.18 / 64.83 ±1.17 / 66.17 ms │        65.19 / 67.94 ±3.81 / 75.34 ms │     no change │
│ QQuery 88 │        65.22 / 66.36 ±1.33 / 68.54 ms │        64.52 / 65.39 ±0.62 / 66.41 ms │     no change │
│ QQuery 89 │        36.45 / 37.14 ±0.44 / 37.71 ms │        36.25 / 36.80 ±0.44 / 37.52 ms │     no change │
│ QQuery 90 │        17.56 / 17.76 ±0.14 / 17.92 ms │        17.76 / 18.55 ±1.26 / 21.05 ms │     no change │
│ QQuery 91 │        46.54 / 47.13 ±0.56 / 48.14 ms │        46.93 / 48.76 ±2.61 / 53.84 ms │     no change │
│ QQuery 92 │        29.99 / 30.60 ±0.42 / 31.29 ms │        30.38 / 30.97 ±0.50 / 31.67 ms │     no change │
│ QQuery 93 │        50.92 / 53.44 ±3.09 / 59.37 ms │        50.54 / 51.61 ±0.77 / 52.60 ms │     no change │
│ QQuery 94 │        40.26 / 40.69 ±0.40 / 41.34 ms │        38.72 / 39.32 ±0.50 / 40.04 ms │     no change │
│ QQuery 95 │        83.53 / 84.01 ±0.34 / 84.55 ms │        83.96 / 85.71 ±1.44 / 88.31 ms │     no change │
│ QQuery 96 │        24.77 / 25.05 ±0.18 / 25.29 ms │        24.92 / 25.03 ±0.09 / 25.20 ms │     no change │
│ QQuery 97 │        47.77 / 49.90 ±3.78 / 57.44 ms │        46.99 / 47.52 ±0.40 / 47.97 ms │     no change │
│ QQuery 98 │        43.28 / 44.21 ±0.49 / 44.71 ms │        42.96 / 43.38 ±0.35 / 44.00 ms │     no change │
│ QQuery 99 │        70.47 / 70.83 ±0.24 / 71.15 ms │        71.14 / 73.75 ±3.95 / 81.45 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                              ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                              │ 10368.24ms │
│ Total Time (split-aggr-simplify-ht-template)   │ 10480.63ms │
│ Average Time (HEAD)                            │   104.73ms │
│ Average Time (split-aggr-simplify-ht-template) │   105.86ms │
│ Queries Faster                                 │         22 │
│ Queries Slower                                 │         16 │
│ Queries with No Change                         │         61 │
│ 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 236.6s
CPU sys 5.9s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 2.0 GiB
Avg memory 1.4 GiB
CPU user 239.3s
CPU sys 6.2s
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-simplify-ht-template
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃       split-aggr-simplify-ht-template ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.23 / 3.94 ±5.33 / 14.61 ms │          1.22 / 3.99 ±5.44 / 14.88 ms │     no change │
│ QQuery 1  │        12.80 / 12.99 ±0.19 / 13.29 ms │        12.65 / 12.98 ±0.18 / 13.16 ms │     no change │
│ QQuery 2  │        35.67 / 36.16 ±0.29 / 36.46 ms │        35.70 / 35.94 ±0.28 / 36.36 ms │     no change │
│ QQuery 3  │        31.26 / 31.94 ±0.50 / 32.54 ms │        30.61 / 30.96 ±0.38 / 31.63 ms │     no change │
│ QQuery 4  │     222.77 / 226.67 ±2.50 / 229.47 ms │     224.49 / 230.55 ±4.71 / 236.33 ms │     no change │
│ QQuery 5  │     271.92 / 273.36 ±1.45 / 275.83 ms │     269.51 / 270.89 ±1.53 / 273.73 ms │     no change │
│ QQuery 6  │           1.27 / 1.42 ±0.22 / 1.85 ms │           1.28 / 1.41 ±0.21 / 1.82 ms │     no change │
│ QQuery 7  │        13.69 / 13.90 ±0.14 / 14.08 ms │        13.97 / 14.04 ±0.09 / 14.21 ms │     no change │
│ QQuery 8  │     320.03 / 324.59 ±3.15 / 328.27 ms │     317.32 / 322.67 ±2.81 / 325.35 ms │     no change │
│ QQuery 9  │     451.80 / 465.25 ±9.17 / 477.85 ms │     445.42 / 461.89 ±9.76 / 476.08 ms │     no change │
│ QQuery 10 │        69.04 / 71.24 ±1.52 / 73.34 ms │        70.19 / 75.80 ±8.62 / 92.97 ms │  1.06x slower │
│ QQuery 11 │        81.01 / 81.95 ±1.06 / 83.99 ms │        80.49 / 84.47 ±6.97 / 98.39 ms │     no change │
│ QQuery 12 │     266.88 / 270.66 ±3.56 / 276.24 ms │     265.52 / 270.77 ±4.85 / 278.50 ms │     no change │
│ QQuery 13 │    364.40 / 382.33 ±13.86 / 397.11 ms │    366.52 / 385.50 ±13.83 / 405.89 ms │     no change │
│ QQuery 14 │     279.88 / 288.04 ±7.54 / 299.40 ms │    284.47 / 297.53 ±13.09 / 320.07 ms │     no change │
│ QQuery 15 │     269.03 / 276.88 ±5.43 / 285.07 ms │     272.06 / 279.75 ±9.12 / 296.70 ms │     no change │
│ QQuery 16 │     612.45 / 622.18 ±7.73 / 634.14 ms │     618.41 / 628.10 ±7.01 / 636.30 ms │     no change │
│ QQuery 17 │     613.79 / 625.83 ±7.54 / 635.26 ms │    621.01 / 637.11 ±10.77 / 651.97 ms │     no change │
│ QQuery 18 │ 1244.78 / 1280.13 ±31.37 / 1334.57 ms │ 1248.63 / 1286.16 ±33.60 / 1331.46 ms │     no change │
│ QQuery 19 │        27.65 / 30.20 ±4.46 / 39.11 ms │        27.92 / 28.19 ±0.20 / 28.48 ms │ +1.07x faster │
│ QQuery 20 │     519.75 / 525.12 ±5.41 / 535.38 ms │     515.70 / 522.81 ±7.48 / 535.12 ms │     no change │
│ QQuery 21 │     517.58 / 523.86 ±5.36 / 532.49 ms │     514.68 / 518.79 ±3.83 / 525.23 ms │     no change │
│ QQuery 22 │   994.96 / 1003.23 ±5.43 / 1009.97 ms │    981.63 / 992.99 ±8.70 / 1003.03 ms │     no change │
│ QQuery 23 │ 3057.30 / 3076.89 ±12.09 / 3093.48 ms │ 3029.57 / 3085.31 ±45.37 / 3163.95 ms │     no change │
│ QQuery 24 │        45.50 / 50.25 ±3.91 / 54.22 ms │       41.89 / 50.27 ±10.12 / 67.72 ms │     no change │
│ QQuery 25 │     111.33 / 112.48 ±1.18 / 114.45 ms │     111.64 / 112.41 ±0.59 / 113.20 ms │     no change │
│ QQuery 26 │        42.07 / 45.22 ±5.03 / 55.17 ms │       42.61 / 48.26 ±10.24 / 68.72 ms │  1.07x slower │
│ QQuery 27 │     663.60 / 667.89 ±3.42 / 672.65 ms │     671.31 / 673.95 ±1.72 / 676.21 ms │     no change │
│ QQuery 28 │ 3027.26 / 3050.11 ±16.26 / 3068.78 ms │ 3029.47 / 3045.96 ±14.91 / 3073.77 ms │     no change │
│ QQuery 29 │        40.65 / 41.41 ±0.67 / 42.45 ms │        40.57 / 40.90 ±0.20 / 41.09 ms │     no change │
│ QQuery 30 │     302.71 / 317.30 ±9.91 / 327.52 ms │    295.66 / 314.31 ±16.13 / 336.61 ms │     no change │
│ QQuery 31 │     282.63 / 293.86 ±8.98 / 309.90 ms │     283.45 / 287.82 ±4.37 / 295.60 ms │     no change │
│ QQuery 32 │   932.96 / 965.77 ±27.59 / 1015.55 ms │   934.47 / 969.00 ±26.38 / 1002.85 ms │     no change │
│ QQuery 33 │ 1448.69 / 1482.34 ±20.51 / 1499.55 ms │ 1465.69 / 1489.51 ±16.05 / 1508.04 ms │     no change │
│ QQuery 34 │ 1460.72 / 1501.09 ±36.32 / 1549.48 ms │ 1475.82 / 1492.93 ±16.05 / 1514.32 ms │     no change │
│ QQuery 35 │    276.96 / 318.14 ±42.38 / 391.27 ms │    278.19 / 303.99 ±32.57 / 363.81 ms │     no change │
│ QQuery 36 │        65.23 / 67.13 ±1.85 / 70.33 ms │        67.72 / 75.33 ±5.66 / 84.04 ms │  1.12x slower │
│ QQuery 37 │        35.69 / 40.55 ±7.19 / 54.78 ms │        35.83 / 36.69 ±0.80 / 38.16 ms │ +1.11x faster │
│ QQuery 38 │        40.68 / 42.98 ±2.04 / 45.91 ms │        40.44 / 42.49 ±1.97 / 44.99 ms │     no change │
│ QQuery 39 │    146.84 / 154.82 ±10.96 / 176.57 ms │     140.04 / 151.58 ±6.59 / 158.10 ms │     no change │
│ QQuery 40 │        14.07 / 14.66 ±0.74 / 15.92 ms │        14.38 / 14.83 ±0.35 / 15.43 ms │     no change │
│ QQuery 41 │        13.45 / 13.74 ±0.33 / 14.38 ms │        13.71 / 13.91 ±0.16 / 14.19 ms │     no change │
│ QQuery 42 │        13.11 / 15.13 ±3.61 / 22.35 ms │        13.49 / 15.85 ±4.45 / 24.75 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                              ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                              │ 19643.63ms │
│ Total Time (split-aggr-simplify-ht-template)   │ 19658.61ms │
│ Average Time (HEAD)                            │   456.83ms │
│ Average Time (split-aggr-simplify-ht-template) │   457.18ms │
│ Queries Faster                                 │          2 │
│ Queries Slower                                 │          3 │
│ Queries with No Change                         │         38 │
│ Queries with Failure                           │          0 │
└────────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 100.0s
Peak memory 10.6 GiB
Avg memory 4.5 GiB
CPU user 1010.6s
CPU sys 70.2s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 100.0s
Peak memory 10.4 GiB
Avg memory 4.2 GiB
CPU user 1007.5s
CPU sys 71.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rachelint

Rachelint commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Some thoughts about later refactoring:

  • maybe we should not only maintain the agg hashtable in such approach:
hashtable
- common
- final
- partial
  • but also maintain all the agg context following this, the re-originized code structure may be like:
grouped_hash
- common (place the common contexts like generic hashtable `AggregateHashTable<T>`)
- final (all contexts about final)
  * final hashtable
  * final agg stream
  * optimizations about final
- partial(all contexts about final)
  * partial hashtable
  * partial agg stream
  * partial skip hashtable
  * skip_partial.rs
  * other optimizations about partial

What do you think about this idea @2010YOUY01 @alamb

@alamb

alamb commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What do you think about this idea @2010YOUY01 @alamb

I think it sounds good.

I think there are some other major parts too:

  1. the NoGrouping (AggregateStream): https://github.com/apache/datafusion/blob/12bd5b076584b1eeac0e5357afce8ae6d3cd72be/datafusion/physical-plan/src/aggregates/no_grouping.rs#L48-L47
  2. Also the ordering (OrderedFinalAggregateStream, OrderedPartialAggregateStream, etc)

Looking at the names of the modules, in this directory I also feel the structure is somewhat lost

Screenshot 2026-07-07 at 7 31 50 AM

I made a PR to try and name them more consistently:

@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 and @Rachelint -- this looks very nice to me

I have a few stylistic / simplification suggestions, but nothing I think is required or could not be done as a follow on

/// Each aggregation mode chooses a different `aggregate_fn` according to its
/// semantics. For example, partial aggregation takes raw inputs, and update them
/// into stored partial states, so [`GroupsAccumulator::update_batch`] is used.
pub(super) fn aggregate_batch_inner<F>(

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.

can you please document somewhere what these arguments are? Specifically the &[usize] and usize arguments?

Something like

/// Function used by [`AggregateHashTable::aggregate_batch_inner`] to update one
/// accumulator with one evaluated input batch.
///
/// Arguments:
/// * accumulator  to update. 
/// * accumulator's evaluated arguments and optional filter. 
/// * `&[usize]` with one group index per input row, mapping each row to its interned group
/// * total number of groups currently interned in that buffer, including newly interned groups
pub(super) type AggregateBatchFn = fn(
    &mut AggregateAccumulator,
    &EvaluatedAccumulatorArgs,
    &[usize],
    usize,
) -> Result<()>;

So then this would be something like

pub(super) fn aggregate_batch_inner<F: AggregateBatchFn>(
  &mut self,
  batch: &RecordBatch,
  mut aggregate_fn: F
)   -> Result<()>

Comment on lines +72 to +74
|acc, values, group_indices, total_num_groups| {
acc.merge_batch(values, group_indices, total_num_groups)
},

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 you can use the method name directly here

    pub(in crate::aggregates) fn aggregate_batch(
        &mut self,
        batch: &RecordBatch,
    ) -> Result<()> {
        self.aggregate_batch_inner(batch, AggregateAccumulator::merge_batch)
    }

self.state = AggregateHashTableState::OutputtingMaterialized(output);
}
batch
self.next_output_batch_inner(|acc, emit_to, output| {

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.

likewise here I think you can just use the method name directly

        self.next_output_batch_inner(Self::materialize_partial_reduce_output)

///
/// This is a temporary solution until blocked state management is implemented:
/// Issue: <https://github.com/apache/datafusion/issues/7065>
pub(super) fn next_output_batch_inner<F>(

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.

Similarly, here I think a new typedef would help

/// Function used by [`AggregateHashTable::next_output_batch_inner`] to
/// materialize all currently buffered output for one aggregation mode.
///
/// Arguments
/// * hash table that is producing output
/// *The outputting buffer moved out of the table state
/// * output schema for the materialized [`RecordBatch`].
pub(super) type NextOutputBatchFn<AggrMode> = fn(
    &AggregateHashTable<AggrMode>,
    AggregateHashTableBuffer,
    SchemaRef,
) -> Result<MaterializedAggregateOutput>;

Ok(())
self.aggregate_batch_inner(
batch,
|acc, values, group_indices, total_num_groups| {

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.

here too

        self.aggregate_batch_inner(batch, AggregateAccumulator::merge_batch)

let mut output = state.group_values.emit(emit_to)?;

for acc in state.accumulators.iter_mut() {
self.next_output_batch_inner(|acc, emit_to, output| {

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.

        self.next_output_batch_inner(Self::materialize_partial_output)

}

Ok(())
self.aggregate_batch_inner(

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.

        self.aggregate_batch_inner(batch, HashAggregateAccumulator::update_batch)

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

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants