Skip to content

fix: Handle potential overflow in internal state for avg(decimal)#22714

Merged
alamb merged 6 commits into
apache:mainfrom
AdamGS:adamg/fix-avg-decimal-overflow
Jul 15, 2026
Merged

fix: Handle potential overflow in internal state for avg(decimal)#22714
alamb merged 6 commits into
apache:mainfrom
AdamGS:adamg/fix-avg-decimal-overflow

Conversation

@AdamGS

@AdamGS AdamGS commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Fixes a bug with avg that currently prevents us from running TPC-DS q1. I think that this issues is masked by Parquet because the current implementations infers that columns as a Decimal128.

What changes are included in this PR?

  1. Mark Decimal32/64 as R in sqllogictest, like the bigger decimal types, and fixes some tests that used ?. (this can be a separate PR, but its seems very small).
  2. Adds a test for decimal32 overflow
  3. DecimalAvgAccumulator now takes another type to hold its inner sum accumulator, which can be different than the input/output type.
  4. Decimal32, Decimal64 and Decimal256 use larger types to track the sum in order to prevent an overflow
  5. Adds some unit tests for the AVG impl building blocks.

Are these changes tested?

Additional SLT test that would've overflowed internally, and more focused unit tests for AvgGroupsAccumulator

Are there any user-facing changes?

None, just more code that doesn't currently work and will work now.

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

@AdamGS

Thanks for working on this. The widening approach for Decimal32/64 looks good, but I think there are still correctness gaps around Decimal128 accumulation that need to be addressed before this can land. I also have a couple of non-blocking suggestions around SLT normalization and reducing duplication in the decimal averaging paths.

target_precision: *target_precision,
target_scale: *target_scale,
})),
) => Ok(Box::new(DecimalAvgAccumulator::<Decimal128Type>::new(

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 there is still a correctness issue here for Decimal128 AVG. The accumulator state remains Decimal128Type, and the new summation path uses add_wrapping (for example at lines 651, 672, and 947). That means intermediate overflow can still silently wrap before DecimalAverager gets a chance to run.

For example, avg(arrow_cast('999999999999999999999999999999.9999', 'Decimal128(34, 4)')) over roughly 20,000 rows has a valid Decimal128(38, 8) result, but the intermediate Decimal128 sum exceeds i128::MAX and wraps along the way. At that point the average is already corrupted even though the final result would be representable.

Could we widen the Decimal128 accumulation state (for example to Decimal256) or otherwise use checked/compensated accumulation so intermediate overflow does not invalidate averages whose final result fits?

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.

So it currently doesn't compile because the current code here assumes that the type we use for the sum can be Into<I>, but turns out that doesn't exist for i256 and i128, I opened a PR to arrow, which might delay this part but I'll fix everything else.

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 the same issue still exists for AVG(DISTINCT) on decimals. The distinct path constructs DecimalDistinctAvgAccumulator::<Decimal32Type>, Decimal64Type, and Decimal128Type, and those accumulators still sum distinct values in the native type using wrapping arithmetic.

AVG(DISTINCT) is still an average, so it can hit the same intermediate overflow problem whenever the average is representable but the sum is not. Could the widening/state-type fix be applied here as well? Otherwise it would be good to explicitly narrow the supported contract and add tests that document the unsupported behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll take a look, I tried to keep this PR a bit smaller but I definitely suspect it has the same issue.

DataType::Float16
| DataType::Float32
| DataType::Float64
| DataType::Decimal32(_, _)

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.

Small suggestion: mapping Decimal32/Decimal64 globally to DFColumnType::Float makes SLT comparisons approximate for these decimal types and could hide formatting or rounding regressions that would otherwise be caught.

If the motivation is only the affected power/round queries, would it make sense to keep exact/text comparisons there instead? At minimum, it may be worth documenting why all Decimal32/64 SLT output is now treated approximately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think display should be exact, I even made sure to extend it to decimal32/64 here

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.

# example of passing test (DFColumnType::Float makes SLT comparisons approximate for these decimal types) which should fail 
+query R
+select arrow_cast('1.2300', 'Decimal32(9, 4)');
+----
+1.23

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this should be a different issue, I'll open it later today as I did #23161

@@ -365,17 +370,27 @@ impl AggregateUDFImpl for Avg {
Decimal32(_sum_precision, sum_scale),

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.

Small refactoring suggestion: the Decimal32 and Decimal64 branches both follow the same pattern of creating a wider DecimalAverager, dividing by a widened count, and then try_from-ing back to the output native type.

It might be nice to factor that into a helper such as avg_decimal_with_wider_sum. That would encode the widening invariant in one place and help keep the accumulator and group-accumulator paths aligned over time.

AdamGS added 4 commits July 10, 2026 13:36
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
@AdamGS AdamGS force-pushed the adamg/fix-avg-decimal-overflow branch from cdd0af7 to 7a695d2 Compare July 10, 2026 13:53
@AdamGS AdamGS requested a review from kosiew July 10, 2026 16:56
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
@AdamGS AdamGS force-pushed the adamg/fix-avg-decimal-overflow branch from 3bf7e53 to f8f0ab8 Compare July 10, 2026 16:59
/// of reach. `Decimal256` input near max precision is the exception: no wider
/// type exists, so its sum keeps only whatever headroom `Decimal256(76, _)` has
/// left, as before this budget was introduced.
const AVG_SUM_HEADROOM_DIGITS: u8 = 4 + 9;

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 seems like a reasonable heuristic to me, while keeping reasonable performance in most cases. The alternative here would be to always use i256 for the intermediate sum which is much slower.

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

Looks 👍 to me

@alamb

alamb commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

run benchmarks

@alamb

alamb commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

I think the tpch tests uses decimal and avg

@alamb

alamb commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

(BTW thank you @kosiew for your never ending reviews -- it is very much appreciated)

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4981175249-1078-mpr7n 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 adamg/fix-avg-decimal-overflow (90dd6ff) to 754e113 (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-c4981175249-1079-b7f8g 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 adamg/fix-avg-decimal-overflow (90dd6ff) to 754e113 (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-c4981175249-1077-6dtl4 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 adamg/fix-avg-decimal-overflow (90dd6ff) to 754e113 (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 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 adamg_fix-avg-decimal-overflow
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃ adamg_fix-avg-decimal-overflow ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 38.58 / 39.63 ±1.09 / 41.42 ms │ 38.66 / 40.18 ±1.41 / 41.90 ms │ no change │
│ QQuery 2  │ 19.16 / 19.53 ±0.24 / 19.92 ms │ 19.52 / 19.83 ±0.34 / 20.48 ms │ no change │
│ QQuery 3  │ 33.83 / 35.55 ±1.30 / 37.35 ms │ 33.46 / 34.50 ±1.10 / 36.62 ms │ no change │
│ QQuery 4  │ 17.70 / 18.26 ±0.60 / 19.40 ms │ 17.62 / 17.82 ±0.12 / 17.98 ms │ no change │
│ QQuery 5  │ 38.15 / 39.55 ±1.24 / 41.30 ms │ 37.61 / 40.71 ±1.95 / 43.73 ms │ no change │
│ QQuery 6  │ 16.36 / 16.77 ±0.54 / 17.82 ms │ 16.39 / 16.63 ±0.27 / 17.14 ms │ no change │
│ QQuery 7  │ 43.86 / 45.93 ±1.98 / 49.50 ms │ 43.39 / 45.58 ±3.05 / 51.57 ms │ no change │
│ QQuery 8  │ 43.17 / 43.52 ±0.31 / 44.04 ms │ 43.09 / 43.46 ±0.27 / 43.78 ms │ no change │
│ QQuery 9  │ 49.84 / 50.66 ±0.46 / 51.15 ms │ 50.15 / 51.34 ±0.68 / 52.08 ms │ no change │
│ QQuery 10 │ 42.66 / 43.36 ±1.13 / 45.61 ms │ 42.36 / 43.23 ±1.15 / 45.47 ms │ no change │
│ QQuery 11 │ 13.46 / 13.71 ±0.14 / 13.90 ms │ 13.75 / 13.87 ±0.08 / 13.99 ms │ no change │
│ QQuery 12 │ 23.82 / 24.19 ±0.29 / 24.51 ms │ 24.31 / 24.58 ±0.24 / 25.01 ms │ no change │
│ QQuery 13 │ 32.00 / 32.81 ±0.54 / 33.53 ms │ 32.63 / 33.13 ±0.81 / 34.75 ms │ no change │
│ QQuery 14 │ 23.35 / 23.79 ±0.22 / 23.95 ms │ 23.82 / 24.02 ±0.14 / 24.26 ms │ no change │
│ QQuery 15 │ 31.28 / 31.55 ±0.30 / 32.12 ms │ 31.49 / 32.08 ±0.61 / 33.08 ms │ no change │
│ QQuery 16 │ 14.21 / 14.41 ±0.13 / 14.56 ms │ 14.18 / 14.34 ±0.11 / 14.47 ms │ no change │
│ QQuery 17 │ 72.09 / 73.38 ±1.47 / 76.11 ms │ 71.70 / 73.01 ±1.41 / 75.68 ms │ no change │
│ QQuery 18 │ 59.61 / 60.56 ±1.01 / 62.43 ms │ 60.13 / 60.85 ±0.86 / 62.51 ms │ no change │
│ QQuery 19 │ 32.90 / 33.78 ±0.94 / 35.60 ms │ 33.43 / 33.75 ±0.31 / 34.31 ms │ no change │
│ QQuery 20 │ 32.16 / 32.37 ±0.11 / 32.46 ms │ 32.07 / 32.33 ±0.26 / 32.81 ms │ no change │
│ QQuery 21 │ 56.20 / 57.37 ±1.28 / 58.97 ms │ 55.74 / 57.73 ±1.56 / 59.32 ms │ no change │
│ QQuery 22 │ 14.33 / 14.43 ±0.07 / 14.54 ms │ 14.00 / 14.19 ±0.16 / 14.40 ms │ no change │
└───────────┴────────────────────────────────┴────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                             ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 765.12ms │
│ Total Time (adamg_fix-avg-decimal-overflow)   │ 767.13ms │
│ Average Time (HEAD)                           │  34.78ms │
│ Average Time (adamg_fix-avg-decimal-overflow) │  34.87ms │
│ 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 502.7 MiB
CPU user 22.1s
CPU sys 1.7s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.0 GiB
Avg memory 482.3 MiB
CPU user 22.1s
CPU sys 1.8s
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 adamg_fix-avg-decimal-overflow
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃        adamg_fix-avg-decimal-overflow ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.35 / 5.94 ±0.88 / 7.67 ms │           5.34 / 5.91 ±0.95 / 7.80 ms │     no change │
│ QQuery 2  │        79.76 / 80.26 ±0.38 / 80.80 ms │        80.86 / 81.16 ±0.20 / 81.43 ms │     no change │
│ QQuery 3  │        29.72 / 29.88 ±0.24 / 30.35 ms │        29.58 / 29.83 ±0.22 / 30.13 ms │     no change │
│ QQuery 4  │     491.76 / 494.14 ±3.45 / 500.93 ms │     488.23 / 491.37 ±1.98 / 494.45 ms │     no change │
│ QQuery 5  │        51.94 / 52.52 ±0.60 / 53.64 ms │        51.60 / 52.29 ±0.45 / 52.77 ms │     no change │
│ QQuery 6  │        36.59 / 37.32 ±0.45 / 37.97 ms │        36.73 / 37.02 ±0.27 / 37.42 ms │     no change │
│ QQuery 7  │        94.61 / 95.94 ±0.92 / 97.49 ms │        94.45 / 94.93 ±0.38 / 95.58 ms │     no change │
│ QQuery 8  │        36.96 / 38.59 ±2.01 / 42.48 ms │        36.95 / 37.76 ±1.17 / 40.09 ms │     no change │
│ QQuery 9  │        52.20 / 54.67 ±1.61 / 57.16 ms │        52.90 / 53.80 ±0.89 / 55.34 ms │     no change │
│ QQuery 10 │        63.68 / 64.23 ±0.50 / 65.16 ms │        63.45 / 63.80 ±0.36 / 64.29 ms │     no change │
│ QQuery 11 │     310.17 / 316.91 ±4.05 / 321.51 ms │     298.75 / 309.07 ±6.57 / 317.70 ms │     no change │
│ QQuery 12 │        28.87 / 29.34 ±0.37 / 29.91 ms │        28.52 / 28.92 ±0.30 / 29.33 ms │     no change │
│ QQuery 13 │     119.25 / 120.39 ±1.64 / 123.64 ms │     118.73 / 120.01 ±1.80 / 123.53 ms │     no change │
│ QQuery 14 │     415.91 / 418.31 ±1.74 / 421.19 ms │     413.00 / 415.63 ±1.73 / 418.24 ms │     no change │
│ QQuery 15 │        58.37 / 58.94 ±0.49 / 59.80 ms │        57.20 / 58.21 ±0.78 / 59.59 ms │     no change │
│ QQuery 16 │           6.62 / 6.79 ±0.25 / 7.28 ms │           6.44 / 6.60 ±0.18 / 6.93 ms │     no change │
│ QQuery 17 │        81.42 / 82.25 ±0.86 / 83.90 ms │        79.88 / 80.92 ±1.43 / 83.71 ms │     no change │
│ QQuery 18 │     125.12 / 126.44 ±1.16 / 127.78 ms │     123.54 / 124.55 ±0.82 / 125.61 ms │     no change │
│ QQuery 19 │        42.29 / 42.52 ±0.27 / 43.02 ms │        42.21 / 42.49 ±0.16 / 42.63 ms │     no change │
│ QQuery 20 │        35.64 / 36.22 ±0.33 / 36.61 ms │        36.12 / 37.23 ±1.01 / 38.97 ms │     no change │
│ QQuery 21 │        17.49 / 17.99 ±0.28 / 18.28 ms │        17.61 / 17.83 ±0.21 / 18.20 ms │     no change │
│ QQuery 22 │        63.45 / 63.90 ±0.38 / 64.60 ms │        63.72 / 65.74 ±1.88 / 68.60 ms │     no change │
│ QQuery 23 │    348.71 / 360.77 ±13.13 / 385.51 ms │     348.28 / 353.19 ±3.19 / 357.87 ms │     no change │
│ QQuery 24 │     227.16 / 228.80 ±1.77 / 231.97 ms │     226.44 / 228.74 ±2.80 / 233.89 ms │     no change │
│ QQuery 25 │     110.38 / 112.18 ±1.56 / 114.85 ms │     110.50 / 111.41 ±1.28 / 113.84 ms │     no change │
│ QQuery 26 │        57.50 / 59.64 ±1.99 / 62.89 ms │        57.85 / 59.86 ±1.85 / 63.10 ms │     no change │
│ QQuery 27 │           6.08 / 6.22 ±0.20 / 6.62 ms │           6.30 / 6.44 ±0.14 / 6.70 ms │     no change │
│ QQuery 28 │        56.88 / 59.91 ±2.26 / 62.55 ms │        61.37 / 62.08 ±0.74 / 63.14 ms │     no change │
│ QQuery 29 │      98.88 / 100.06 ±1.28 / 102.47 ms │      97.42 / 100.13 ±4.17 / 108.39 ms │     no change │
│ QQuery 30 │        32.77 / 34.58 ±1.63 / 37.65 ms │        32.57 / 33.12 ±0.37 / 33.72 ms │     no change │
│ QQuery 31 │     112.41 / 113.61 ±0.91 / 114.88 ms │     112.59 / 112.91 ±0.17 / 113.10 ms │     no change │
│ QQuery 32 │        20.59 / 20.99 ±0.24 / 21.31 ms │        20.68 / 20.80 ±0.14 / 21.05 ms │     no change │
│ QQuery 33 │        38.48 / 39.99 ±1.43 / 41.93 ms │        38.36 / 38.74 ±0.41 / 39.38 ms │     no change │
│ QQuery 34 │         9.88 / 10.28 ±0.46 / 11.17 ms │        10.18 / 10.41 ±0.18 / 10.65 ms │     no change │
│ QQuery 35 │        74.17 / 74.80 ±0.55 / 75.62 ms │        73.75 / 74.81 ±0.88 / 75.86 ms │     no change │
│ QQuery 36 │           5.54 / 5.75 ±0.19 / 6.08 ms │           5.63 / 5.76 ±0.19 / 6.13 ms │     no change │
│ QQuery 37 │           6.84 / 6.90 ±0.05 / 7.00 ms │           6.78 / 6.83 ±0.07 / 6.96 ms │     no change │
│ QQuery 38 │        63.05 / 63.41 ±0.24 / 63.79 ms │        62.56 / 62.88 ±0.26 / 63.29 ms │     no change │
│ QQuery 39 │        90.86 / 93.67 ±2.94 / 97.28 ms │        90.34 / 92.48 ±3.06 / 98.56 ms │     no change │
│ QQuery 40 │        23.92 / 24.22 ±0.20 / 24.44 ms │        23.70 / 24.02 ±0.31 / 24.57 ms │     no change │
│ QQuery 41 │        11.66 / 11.84 ±0.21 / 12.23 ms │        11.78 / 12.01 ±0.21 / 12.31 ms │     no change │
│ QQuery 42 │        24.20 / 24.58 ±0.34 / 25.06 ms │        24.05 / 24.59 ±0.52 / 25.55 ms │     no change │
│ QQuery 43 │           4.88 / 4.98 ±0.14 / 5.26 ms │           5.01 / 5.11 ±0.13 / 5.37 ms │     no change │
│ QQuery 44 │           9.01 / 9.23 ±0.12 / 9.37 ms │           9.38 / 9.53 ±0.15 / 9.80 ms │     no change │
│ QQuery 45 │        38.37 / 39.16 ±0.64 / 39.95 ms │        38.44 / 38.74 ±0.22 / 39.04 ms │     no change │
│ QQuery 46 │        11.77 / 12.00 ±0.14 / 12.15 ms │        11.88 / 12.10 ±0.23 / 12.40 ms │     no change │
│ QQuery 47 │     229.13 / 233.50 ±3.37 / 237.86 ms │     232.58 / 237.56 ±4.92 / 246.12 ms │     no change │
│ QQuery 48 │        96.21 / 97.50 ±0.79 / 98.59 ms │        96.81 / 97.95 ±1.10 / 99.82 ms │     no change │
│ QQuery 49 │        76.80 / 78.99 ±2.36 / 83.22 ms │        77.03 / 78.48 ±2.28 / 83.03 ms │     no change │
│ QQuery 50 │        59.70 / 60.44 ±0.42 / 60.94 ms │        59.62 / 60.71 ±0.77 / 61.78 ms │     no change │
│ QQuery 51 │        92.81 / 94.07 ±0.94 / 95.64 ms │        91.38 / 93.02 ±0.85 / 93.80 ms │     no change │
│ QQuery 52 │        24.48 / 24.76 ±0.21 / 25.06 ms │        24.63 / 24.80 ±0.11 / 24.96 ms │     no change │
│ QQuery 53 │        29.81 / 31.13 ±1.95 / 34.99 ms │        30.15 / 32.37 ±3.26 / 38.82 ms │     no change │
│ QQuery 54 │        56.39 / 56.86 ±0.61 / 58.06 ms │        56.29 / 57.34 ±1.22 / 59.59 ms │     no change │
│ QQuery 55 │        23.82 / 24.19 ±0.32 / 24.74 ms │        23.95 / 24.44 ±0.36 / 25.04 ms │     no change │
│ QQuery 56 │        39.54 / 40.19 ±0.49 / 40.73 ms │        39.03 / 39.56 ±0.37 / 40.05 ms │     no change │
│ QQuery 57 │     176.70 / 178.13 ±1.12 / 179.57 ms │     178.52 / 179.70 ±1.61 / 182.87 ms │     no change │
│ QQuery 58 │     116.23 / 117.63 ±1.31 / 119.97 ms │     115.48 / 117.44 ±1.76 / 120.54 ms │     no change │
│ QQuery 59 │     117.78 / 118.51 ±0.50 / 119.14 ms │     119.32 / 119.69 ±0.47 / 120.63 ms │     no change │
│ QQuery 60 │        40.13 / 40.59 ±0.30 / 40.86 ms │        39.87 / 40.60 ±0.39 / 41.04 ms │     no change │
│ QQuery 61 │        12.21 / 13.04 ±1.16 / 15.32 ms │        12.03 / 13.16 ±1.96 / 17.07 ms │     no change │
│ QQuery 62 │        46.99 / 47.95 ±1.15 / 50.20 ms │        46.62 / 47.18 ±0.81 / 48.79 ms │     no change │
│ QQuery 63 │        30.16 / 30.61 ±0.33 / 31.05 ms │        30.28 / 30.72 ±0.38 / 31.25 ms │     no change │
│ QQuery 64 │     409.02 / 413.72 ±2.76 / 416.77 ms │     411.46 / 413.29 ±1.61 / 415.85 ms │     no change │
│ QQuery 65 │     127.36 / 130.42 ±2.22 / 133.79 ms │     131.13 / 133.15 ±1.74 / 136.31 ms │     no change │
│ QQuery 66 │        80.19 / 81.05 ±0.52 / 81.72 ms │        80.26 / 80.80 ±0.43 / 81.27 ms │     no change │
│ QQuery 67 │     250.58 / 253.77 ±1.98 / 256.10 ms │     250.06 / 251.66 ±2.85 / 257.35 ms │     no change │
│ QQuery 68 │        12.25 / 12.36 ±0.14 / 12.63 ms │        11.85 / 12.02 ±0.18 / 12.33 ms │     no change │
│ QQuery 69 │        59.19 / 62.09 ±3.48 / 68.54 ms │        57.86 / 60.00 ±2.81 / 65.52 ms │     no change │
│ QQuery 70 │     107.21 / 110.21 ±3.76 / 117.54 ms │     106.19 / 108.95 ±3.08 / 113.97 ms │     no change │
│ QQuery 71 │        36.27 / 36.63 ±0.20 / 36.89 ms │        35.30 / 36.46 ±0.68 / 37.23 ms │     no change │
│ QQuery 72 │ 2169.33 / 2241.45 ±51.48 / 2313.24 ms │ 2171.01 / 2244.84 ±80.58 / 2392.27 ms │     no change │
│ QQuery 73 │          9.55 / 9.88 ±0.34 / 10.35 ms │          9.64 / 9.82 ±0.21 / 10.21 ms │     no change │
│ QQuery 74 │     171.44 / 175.04 ±4.94 / 184.47 ms │     174.71 / 179.29 ±3.98 / 186.21 ms │     no change │
│ QQuery 75 │     148.87 / 150.09 ±1.20 / 152.36 ms │     150.18 / 152.32 ±1.58 / 154.65 ms │     no change │
│ QQuery 76 │        35.41 / 35.86 ±0.32 / 36.23 ms │        35.39 / 35.90 ±0.37 / 36.54 ms │     no change │
│ QQuery 77 │        61.68 / 64.27 ±2.41 / 67.29 ms │        62.02 / 64.22 ±2.31 / 68.71 ms │     no change │
│ QQuery 78 │     196.92 / 199.82 ±2.57 / 204.26 ms │     199.05 / 203.15 ±3.12 / 208.58 ms │     no change │
│ QQuery 79 │        67.87 / 68.25 ±0.27 / 68.69 ms │        68.13 / 68.81 ±0.45 / 69.39 ms │     no change │
│ QQuery 80 │     100.55 / 103.76 ±4.08 / 110.59 ms │      98.89 / 102.16 ±2.48 / 106.35 ms │     no change │
│ QQuery 81 │        25.98 / 26.55 ±0.34 / 26.93 ms │        26.96 / 27.91 ±1.69 / 31.29 ms │  1.05x slower │
│ QQuery 82 │        16.29 / 16.64 ±0.23 / 16.85 ms │        16.91 / 17.24 ±0.29 / 17.78 ms │     no change │
│ QQuery 83 │        40.01 / 40.32 ±0.29 / 40.71 ms │        40.59 / 41.10 ±0.75 / 42.59 ms │     no change │
│ QQuery 84 │        30.17 / 30.53 ±0.24 / 30.81 ms │        30.69 / 30.92 ±0.29 / 31.49 ms │     no change │
│ QQuery 85 │     107.60 / 111.06 ±4.13 / 118.67 ms │     108.29 / 111.48 ±3.42 / 117.51 ms │     no change │
│ QQuery 86 │        25.21 / 25.52 ±0.29 / 26.01 ms │        25.75 / 26.24 ±0.35 / 26.66 ms │     no change │
│ QQuery 87 │        62.88 / 64.05 ±1.02 / 65.85 ms │        63.89 / 64.46 ±0.49 / 65.05 ms │     no change │
│ QQuery 88 │        63.43 / 63.93 ±0.44 / 64.59 ms │        63.69 / 66.05 ±3.81 / 73.65 ms │     no change │
│ QQuery 89 │        36.39 / 39.83 ±5.31 / 50.28 ms │        36.82 / 37.75 ±1.14 / 39.91 ms │ +1.06x faster │
│ QQuery 90 │        17.10 / 17.37 ±0.21 / 17.65 ms │        17.56 / 17.66 ±0.12 / 17.89 ms │     no change │
│ QQuery 91 │        45.94 / 46.54 ±0.46 / 47.09 ms │        46.22 / 47.06 ±0.46 / 47.59 ms │     no change │
│ QQuery 92 │        29.62 / 30.24 ±0.42 / 30.82 ms │        30.03 / 31.10 ±0.81 / 32.47 ms │     no change │
│ QQuery 93 │        49.37 / 50.77 ±0.84 / 51.78 ms │        51.50 / 52.13 ±0.40 / 52.67 ms │     no change │
│ QQuery 94 │        38.76 / 40.13 ±1.49 / 42.54 ms │        39.07 / 40.88 ±2.15 / 45.03 ms │     no change │
│ QQuery 95 │        81.15 / 82.63 ±1.62 / 85.63 ms │        81.26 / 82.93 ±1.44 / 85.15 ms │     no change │
│ QQuery 96 │        24.37 / 24.56 ±0.24 / 25.02 ms │        24.67 / 24.79 ±0.12 / 24.95 ms │     no change │
│ QQuery 97 │        47.48 / 47.61 ±0.13 / 47.82 ms │        47.05 / 47.45 ±0.26 / 47.75 ms │     no change │
│ QQuery 98 │        43.54 / 45.44 ±2.13 / 49.34 ms │        43.65 / 44.38 ±0.63 / 45.55 ms │     no change │
│ QQuery 99 │        70.41 / 70.85 ±0.27 / 71.22 ms │        70.46 / 71.44 ±0.90 / 72.83 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                             ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 10102.39ms │
│ Total Time (adamg_fix-avg-decimal-overflow)   │ 10096.27ms │
│ Average Time (HEAD)                           │   102.04ms │
│ Average Time (adamg_fix-avg-decimal-overflow) │   101.98ms │
│ Queries Faster                                │          1 │
│ Queries Slower                                │          1 │
│ Queries with No Change                        │         97 │
│ Queries with Failure                          │          0 │
└───────────────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

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

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 2.1 GiB
Avg memory 1.4 GiB
CPU user 229.6s
CPU sys 5.9s
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 adamg_fix-avg-decimal-overflow
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃        adamg_fix-avg-decimal-overflow ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.24 / 3.95 ±5.33 / 14.61 ms │          1.23 / 3.91 ±5.27 / 14.44 ms │     no change │
│ QQuery 1  │        13.20 / 13.46 ±0.16 / 13.68 ms │        12.72 / 13.01 ±0.17 / 13.18 ms │     no change │
│ QQuery 2  │        37.07 / 37.37 ±0.30 / 37.73 ms │        35.80 / 36.35 ±0.43 / 37.09 ms │     no change │
│ QQuery 3  │        30.78 / 31.53 ±0.81 / 33.03 ms │        30.55 / 30.81 ±0.31 / 31.39 ms │     no change │
│ QQuery 4  │     222.02 / 226.07 ±3.61 / 231.83 ms │     222.82 / 225.00 ±2.28 / 229.27 ms │     no change │
│ QQuery 5  │     268.84 / 271.37 ±2.06 / 273.99 ms │     270.72 / 273.46 ±1.63 / 275.12 ms │     no change │
│ QQuery 6  │           1.28 / 1.44 ±0.24 / 1.91 ms │           1.28 / 1.43 ±0.23 / 1.89 ms │     no change │
│ QQuery 7  │        14.03 / 14.43 ±0.27 / 14.88 ms │        13.85 / 13.97 ±0.09 / 14.09 ms │     no change │
│ QQuery 8  │    323.74 / 336.57 ±21.22 / 378.87 ms │     325.80 / 331.36 ±3.92 / 336.20 ms │     no change │
│ QQuery 9  │     445.71 / 457.70 ±7.28 / 467.35 ms │    456.32 / 468.59 ±10.77 / 483.63 ms │     no change │
│ QQuery 10 │        69.05 / 71.92 ±4.57 / 81.02 ms │        68.48 / 70.60 ±1.49 / 72.53 ms │     no change │
│ QQuery 11 │        80.80 / 81.82 ±1.14 / 83.46 ms │       80.47 / 85.75 ±7.56 / 100.77 ms │     no change │
│ QQuery 12 │     264.67 / 268.47 ±3.85 / 275.84 ms │     268.13 / 273.01 ±3.05 / 277.48 ms │     no change │
│ QQuery 13 │    364.84 / 376.93 ±11.19 / 397.49 ms │     367.82 / 375.20 ±8.78 / 392.46 ms │     no change │
│ QQuery 14 │     281.40 / 285.15 ±2.58 / 289.29 ms │     282.36 / 288.40 ±5.19 / 296.71 ms │     no change │
│ QQuery 15 │     271.54 / 278.85 ±7.36 / 288.20 ms │     270.89 / 278.88 ±5.60 / 287.18 ms │     no change │
│ QQuery 16 │     610.00 / 618.21 ±6.10 / 625.35 ms │     615.11 / 625.75 ±8.25 / 637.40 ms │     no change │
│ QQuery 17 │     627.66 / 637.83 ±8.12 / 644.73 ms │     625.31 / 635.29 ±9.89 / 654.17 ms │     no change │
│ QQuery 18 │ 1265.47 / 1297.18 ±23.82 / 1332.68 ms │ 1272.64 / 1292.87 ±21.65 / 1330.16 ms │     no change │
│ QQuery 19 │        28.04 / 28.38 ±0.42 / 29.19 ms │       28.08 / 35.37 ±11.81 / 58.63 ms │  1.25x slower │
│ QQuery 20 │    513.37 / 526.18 ±14.42 / 548.95 ms │     511.98 / 518.51 ±8.73 / 535.47 ms │     no change │
│ QQuery 21 │     513.08 / 518.88 ±5.68 / 529.33 ms │     512.46 / 515.26 ±3.10 / 521.06 ms │     no change │
│ QQuery 22 │    980.77 / 992.31 ±9.15 / 1006.61 ms │    983.43 / 995.15 ±8.20 / 1004.42 ms │     no change │
│ QQuery 23 │ 3033.27 / 3069.82 ±25.86 / 3109.39 ms │ 3010.87 / 3074.85 ±47.08 / 3143.91 ms │     no change │
│ QQuery 24 │        41.32 / 45.22 ±3.15 / 50.31 ms │        41.33 / 43.00 ±1.66 / 45.50 ms │     no change │
│ QQuery 25 │     111.57 / 112.35 ±0.95 / 114.22 ms │     110.57 / 111.25 ±0.65 / 112.39 ms │     no change │
│ QQuery 26 │        41.75 / 44.89 ±4.82 / 54.32 ms │        41.75 / 42.64 ±0.75 / 43.67 ms │ +1.05x faster │
│ QQuery 27 │     670.67 / 675.94 ±4.54 / 683.89 ms │     666.75 / 674.20 ±5.85 / 684.64 ms │     no change │
│ QQuery 28 │  3025.96 / 3029.63 ±3.02 / 3034.94 ms │ 3001.78 / 3029.44 ±17.08 / 3046.73 ms │     no change │
│ QQuery 29 │        41.24 / 41.84 ±0.61 / 43.00 ms │        41.13 / 44.85 ±6.76 / 58.36 ms │  1.07x slower │
│ QQuery 30 │     302.39 / 315.05 ±9.73 / 327.69 ms │     305.75 / 310.60 ±5.08 / 317.59 ms │     no change │
│ QQuery 31 │    280.02 / 296.58 ±18.54 / 330.36 ms │    281.87 / 292.07 ±11.40 / 311.96 ms │     no change │
│ QQuery 32 │    905.44 / 929.29 ±15.89 / 951.34 ms │     920.83 / 932.40 ±6.06 / 938.21 ms │     no change │
│ QQuery 33 │ 1451.32 / 1468.75 ±26.27 / 1520.11 ms │ 1445.40 / 1467.60 ±17.90 / 1490.42 ms │     no change │
│ QQuery 34 │ 1463.30 / 1509.43 ±33.47 / 1560.65 ms │ 1458.60 / 1491.57 ±22.26 / 1527.87 ms │     no change │
│ QQuery 35 │     282.18 / 286.95 ±3.35 / 291.16 ms │    279.71 / 306.56 ±44.37 / 394.97 ms │  1.07x slower │
│ QQuery 36 │        65.88 / 69.27 ±3.12 / 73.44 ms │        68.01 / 74.56 ±4.32 / 78.75 ms │  1.08x slower │
│ QQuery 37 │        35.88 / 41.93 ±5.25 / 50.17 ms │        35.57 / 40.82 ±3.97 / 45.69 ms │     no change │
│ QQuery 38 │        42.44 / 47.83 ±5.83 / 58.18 ms │        41.56 / 43.85 ±1.49 / 45.54 ms │ +1.09x faster │
│ QQuery 39 │     147.90 / 155.80 ±5.25 / 163.83 ms │     149.01 / 156.84 ±7.21 / 166.34 ms │     no change │
│ QQuery 40 │        14.85 / 21.01 ±9.10 / 38.72 ms │        14.46 / 16.97 ±3.24 / 23.26 ms │ +1.24x faster │
│ QQuery 41 │        13.81 / 14.25 ±0.38 / 14.85 ms │        13.73 / 16.06 ±4.08 / 24.22 ms │  1.13x slower │
│ QQuery 42 │        13.02 / 14.68 ±2.80 / 20.26 ms │        13.15 / 13.48 ±0.19 / 13.73 ms │ +1.09x faster │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                             ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                             │ 19566.50ms │
│ Total Time (adamg_fix-avg-decimal-overflow)   │ 19571.55ms │
│ Average Time (HEAD)                           │   455.03ms │
│ Average Time (adamg_fix-avg-decimal-overflow) │   455.15ms │
│ Queries Faster                                │          4 │
│ Queries Slower                                │          5 │
│ Queries with No Change                        │         34 │
│ Queries with Failure                          │          0 │
└───────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 100.0s
Peak memory 11.1 GiB
Avg memory 4.2 GiB
CPU user 1011.3s
CPU sys 66.4s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 100.0s
Peak memory 11.8 GiB
Avg memory 4.2 GiB
CPU user 1008.4s
CPU sys 68.3s
Peak spill 0 B

File an issue against this benchmark runner

@alamb alamb added this pull request to the merge queue Jul 15, 2026
@alamb

alamb commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🚀

Merged via the queue into apache:main with commit 0099876 Jul 15, 2026
37 checks passed
@AdamGS AdamGS deleted the adamg/fix-avg-decimal-overflow branch July 15, 2026 15:28
@theirix

theirix commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thank you, @AdamGS ! I hope I can reuse the introduced functionality in #22042

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

Labels

functions Changes to functions implementation sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decimal average can overflow because its inner intermediate sum state overflows its storage size

5 participants