Skip to content

feat: Optimize TopK for single primitive column sorts#21336

Closed
Dandandan wants to merge 1 commit intoapache:mainfrom
Dandandan:topk-native-optimization
Closed

feat: Optimize TopK for single primitive column sorts#21336
Dandandan wants to merge 1 commit intoapache:mainfrom
Dandandan:topk-native-optimization

Conversation

@Dandandan
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A — performance optimization.

Rationale for this change

For ORDER BY <single_primitive_column> LIMIT K queries, the current TopK operator converts every incoming row through Arrow's RowConverter into heap-allocated Vec<u8> byte slices, then compares those slices. This has three sources of overhead:

  1. RowConverter batch encoding — converts arrays to row format even though only a scalar comparison is needed
  2. Heap allocation per row — each TopKRow stores a Vec<u8> for the sort key
  3. Byte-slice comparison — variable-length memcmp instead of a single native comparison

What changes are included in this PR?

Adds a specialized native TopK path (TopKInner::Native) for single-column sorts on primitive types (integers, floats, dates, timestamps, durations):

  • NativeTopKRow: stores the sort key as an inline u128 (no heap allocation) with order-preserving encoding that handles ASC/DESC and NULLS FIRST/LAST
  • NativeTopKHeap: BinaryHeap<NativeTopKRow> with the same compaction/emit logic as the existing TopKHeap
  • find_new_native_topk_items: type-dispatched inner loop that downcasts to PrimitiveArray<T> once per batch, then encodes and compares native values directly
  • TopK now holds a TopKInner enum (Row | Native), automatically selecting the native path in try_new when applicable

The existing row-based path is unchanged for multi-column sorts and non-primitive types.

Are these changes tested?

  • All existing TopK unit tests pass (including test_topk_marks_filter_complete which exercises the native path via single Int32 column)
  • All TopK SQL logic tests pass
  • New unit tests for encoding correctness: signed/unsigned integer ordering, float ordering (including NaN/infinity/negative zero), and all four combinations of ASC/DESC × NULLS FIRST/LAST

Are there any user-facing changes?

No — this is a transparent performance optimization. Query results are unchanged.

🤖 Generated with Claude Code

For ORDER BY on a single primitive column (int, float, date, timestamp,
etc.), bypass Arrow's RowConverter entirely and use inline u128 keys with
order-preserving encoding. This avoids heap allocation per row (Vec<u8>),
batch-level row conversion overhead, and variable-length byte-slice
comparison.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Apr 3, 2026
@Dandandan
Copy link
Copy Markdown
Contributor Author

run benchmarks

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4183116894-721-dw24k 6.12.55+ #1 SMP Sun Feb 1 08:59:41 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 topk-native-optimization (e3c43c7) to 1e93a67 (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-c4183116894-720-flqfn 6.12.55+ #1 SMP Sun Feb 1 08:59:41 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 topk-native-optimization (e3c43c7) to 1e93a67 (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-c4183116894-719-w79x9 6.12.55+ #1 SMP Sun Feb 1 08:59:41 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 topk-native-optimization (e3c43c7) to 1e93a67 (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 topk-native-optimization
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃       topk-native-optimization ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1  │ 45.16 / 45.82 ±0.88 / 47.40 ms │ 45.06 / 45.74 ±0.68 / 47.01 ms │    no change │
│ QQuery 2  │ 20.73 / 21.36 ±0.55 / 22.33 ms │ 20.96 / 21.18 ±0.24 / 21.63 ms │    no change │
│ QQuery 3  │ 31.31 / 31.55 ±0.19 / 31.83 ms │ 31.75 / 32.06 ±0.35 / 32.63 ms │    no change │
│ QQuery 4  │ 21.69 / 22.14 ±0.69 / 23.50 ms │ 20.70 / 21.19 ±0.45 / 21.91 ms │    no change │
│ QQuery 5  │ 47.59 / 48.69 ±1.05 / 50.62 ms │ 48.67 / 50.94 ±1.84 / 53.70 ms │    no change │
│ QQuery 6  │ 16.81 / 17.17 ±0.34 / 17.74 ms │ 17.35 / 19.33 ±1.56 / 21.18 ms │ 1.13x slower │
│ QQuery 7  │ 53.29 / 54.35 ±0.84 / 55.50 ms │ 53.90 / 56.08 ±1.78 / 59.20 ms │    no change │
│ QQuery 8  │ 47.58 / 47.86 ±0.16 / 48.02 ms │ 48.04 / 48.66 ±0.62 / 49.81 ms │    no change │
│ QQuery 9  │ 53.45 / 54.17 ±0.73 / 55.41 ms │ 53.37 / 56.17 ±2.94 / 61.60 ms │    no change │
│ QQuery 10 │ 70.24 / 71.85 ±1.34 / 73.84 ms │ 69.46 / 71.93 ±1.69 / 74.57 ms │    no change │
│ QQuery 11 │ 13.80 / 14.04 ±0.26 / 14.51 ms │ 13.86 / 14.20 ±0.42 / 14.95 ms │    no change │
│ QQuery 12 │ 27.30 / 27.67 ±0.38 / 28.18 ms │ 27.37 / 27.99 ±0.43 / 28.48 ms │    no change │
│ QQuery 13 │ 39.48 / 39.94 ±0.70 / 41.32 ms │ 38.84 / 39.57 ±0.69 / 40.79 ms │    no change │
│ QQuery 14 │ 28.42 / 28.73 ±0.26 / 29.13 ms │ 28.33 / 28.55 ±0.29 / 29.10 ms │    no change │
│ QQuery 15 │ 33.00 / 33.31 ±0.17 / 33.48 ms │ 33.20 / 34.20 ±1.00 / 36.06 ms │    no change │
│ QQuery 16 │ 15.62 / 16.36 ±0.49 / 16.86 ms │ 15.49 / 15.97 ±0.35 / 16.41 ms │    no change │
│ QQuery 17 │ 72.48 / 73.39 ±0.87 / 74.73 ms │ 71.90 / 72.86 ±0.99 / 74.76 ms │    no change │
│ QQuery 18 │ 76.52 / 77.55 ±0.62 / 78.23 ms │ 77.23 / 78.04 ±0.54 / 78.71 ms │    no change │
│ QQuery 19 │ 37.14 / 37.48 ±0.30 / 37.94 ms │ 37.51 / 37.77 ±0.24 / 38.21 ms │    no change │
│ QQuery 20 │ 39.36 / 40.53 ±0.72 / 41.32 ms │ 40.18 / 40.88 ±0.71 / 42.18 ms │    no change │
│ QQuery 21 │ 63.03 / 64.83 ±1.04 / 65.94 ms │ 63.55 / 65.73 ±1.39 / 67.29 ms │    no change │
│ QQuery 22 │ 17.78 / 18.18 ±0.25 / 18.53 ms │ 17.55 / 17.99 ±0.33 / 18.52 ms │    no change │
└───────────┴────────────────────────────────┴────────────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                       ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                       │ 886.96ms │
│ Total Time (topk-native-optimization)   │ 897.01ms │
│ Average Time (HEAD)                     │  40.32ms │
│ Average Time (topk-native-optimization) │  40.77ms │
│ Queries Faster                          │        0 │
│ Queries Slower                          │        1 │
│ Queries with No Change                  │       21 │
│ Queries with Failure                    │        0 │
└─────────────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 4.7s
Peak memory 4.0 GiB
Avg memory 3.6 GiB
CPU user 33.4s
CPU sys 2.5s
Disk read 0 B
Disk write 136.0 KiB

tpch — branch

Metric Value
Wall time 4.7s
Peak memory 4.0 GiB
Avg memory 3.6 GiB
CPU user 33.5s
CPU sys 2.7s
Disk read 0 B
Disk write 260.0 KiB

File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

Benchmark for this request failed.

Last 20 lines of output:

Click to expand
Trying to access an element at index 8 from a PrimitiveArray of length 7
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'tokio-rt-worker' (19513) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-58.1.0/src/array/primitive_array.rs:773:9:
Trying to access an element at index 15 from a PrimitiveArray of length 8

thread 'tokio-rt-worker' (19517) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-58.1.0/src/array/primitive_array.rs:773:9:
Trying to access an element at index 11 from a PrimitiveArray of length 10

thread 'tokio-rt-worker' (19522) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-58.1.0/src/array/primitive_array.rs:773:9:
Trying to access an element at index 14 from a PrimitiveArray of length 12

thread 'tokio-rt-worker' (19515) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-58.1.0/src/array/primitive_array.rs:773:9:
Trying to access an element at index 10 from a PrimitiveArray of length 6

thread 'tokio-rt-worker' (19521) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-58.1.0/src/array/primitive_array.rs:773:9:
Trying to access an element at index 13 from a PrimitiveArray of length 12

thread 'tokio-rt-worker' (19514) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-58.1.0/src/array/primitive_array.rs:773:9:
Trying to access an element at index 9 from a PrimitiveArray of length 9

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 topk-native-optimization
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                     HEAD ┃                 topk-native-optimization ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           42.60 / 43.61 ±1.02 / 45.02 ms │           42.43 / 43.13 ±0.72 / 44.52 ms │     no change │
│ QQuery 2  │        145.54 / 146.59 ±0.77 / 147.70 ms │        143.81 / 144.92 ±0.76 / 146.08 ms │     no change │
│ QQuery 3  │        113.11 / 114.44 ±0.81 / 115.26 ms │        112.61 / 113.75 ±0.75 / 114.89 ms │     no change │
│ QQuery 4  │    1291.76 / 1311.23 ±19.54 / 1345.69 ms │    1274.38 / 1313.71 ±23.97 / 1336.53 ms │     no change │
│ QQuery 5  │        170.97 / 174.49 ±2.57 / 178.60 ms │        171.72 / 173.12 ±0.89 / 174.13 ms │     no change │
│ QQuery 6  │    1017.10 / 1034.05 ±11.57 / 1047.76 ms │    1026.82 / 1047.77 ±20.37 / 1076.16 ms │     no change │
│ QQuery 7  │        348.79 / 351.56 ±2.35 / 354.97 ms │        350.83 / 352.94 ±2.63 / 357.96 ms │     no change │
│ QQuery 8  │        116.77 / 117.50 ±0.91 / 119.24 ms │        115.50 / 116.90 ±0.81 / 117.82 ms │     no change │
│ QQuery 9  │        100.95 / 105.81 ±2.49 / 107.74 ms │        100.79 / 103.74 ±3.06 / 108.34 ms │     no change │
│ QQuery 10 │        105.64 / 106.97 ±0.86 / 108.31 ms │        105.51 / 107.38 ±1.35 / 109.02 ms │     no change │
│ QQuery 11 │       868.02 / 893.29 ±15.44 / 910.59 ms │       910.27 / 956.52 ±30.99 / 996.03 ms │  1.07x slower │
│ QQuery 12 │           43.68 / 46.47 ±1.66 / 48.75 ms │           44.39 / 46.10 ±1.52 / 48.72 ms │     no change │
│ QQuery 13 │        397.62 / 400.18 ±2.12 / 403.15 ms │        404.89 / 408.22 ±1.80 / 410.06 ms │     no change │
│ QQuery 14 │     1002.83 / 1009.68 ±7.02 / 1019.52 ms │     1013.28 / 1023.10 ±5.71 / 1030.73 ms │     no change │
│ QQuery 15 │           15.19 / 16.39 ±0.81 / 17.55 ms │           15.26 / 16.35 ±0.68 / 17.14 ms │     no change │
│ QQuery 16 │           40.40 / 40.88 ±0.65 / 42.11 ms │           40.56 / 41.64 ±0.72 / 42.75 ms │     no change │
│ QQuery 17 │        238.81 / 240.02 ±0.93 / 240.84 ms │        236.50 / 242.32 ±3.75 / 245.96 ms │     no change │
│ QQuery 18 │        126.45 / 127.56 ±0.68 / 128.33 ms │        129.53 / 130.71 ±0.74 / 131.78 ms │     no change │
│ QQuery 19 │        155.09 / 155.98 ±0.82 / 157.05 ms │        153.47 / 154.48 ±0.99 / 155.78 ms │     no change │
│ QQuery 20 │           13.63 / 14.37 ±0.51 / 15.17 ms │           13.15 / 13.64 ±0.40 / 14.17 ms │ +1.05x faster │
│ QQuery 21 │           19.32 / 19.68 ±0.30 / 20.16 ms │           18.76 / 19.39 ±0.54 / 20.18 ms │     no change │
│ QQuery 22 │        489.28 / 494.33 ±4.47 / 500.81 ms │        493.38 / 497.53 ±2.48 / 500.49 ms │     no change │
│ QQuery 23 │        882.57 / 891.95 ±8.53 / 905.65 ms │       884.31 / 904.19 ±17.67 / 934.70 ms │     no change │
│ QQuery 24 │        408.87 / 413.35 ±3.96 / 420.76 ms │        423.53 / 429.47 ±3.64 / 434.63 ms │     no change │
│ QQuery 25 │        349.35 / 351.78 ±1.62 / 353.52 ms │        358.48 / 361.24 ±2.63 / 365.57 ms │     no change │
│ QQuery 26 │           82.37 / 83.29 ±1.05 / 85.30 ms │           81.67 / 83.39 ±1.09 / 84.63 ms │     no change │
│ QQuery 27 │        343.54 / 348.31 ±3.61 / 352.70 ms │        355.99 / 358.17 ±1.88 / 360.55 ms │     no change │
│ QQuery 28 │        147.24 / 149.79 ±2.09 / 152.87 ms │        151.07 / 152.82 ±1.51 / 154.68 ms │     no change │
│ QQuery 29 │        293.80 / 296.77 ±2.63 / 300.73 ms │        299.87 / 301.72 ±2.08 / 304.98 ms │     no change │
│ QQuery 30 │           42.50 / 43.83 ±0.72 / 44.62 ms │           43.72 / 46.34 ±2.03 / 49.75 ms │  1.06x slower │
│ QQuery 31 │        168.65 / 171.79 ±1.85 / 173.75 ms │        174.30 / 180.87 ±3.59 / 185.31 ms │  1.05x slower │
│ QQuery 32 │           55.45 / 57.05 ±1.10 / 58.57 ms │           56.63 / 58.34 ±1.34 / 60.46 ms │     no change │
│ QQuery 33 │        141.13 / 142.56 ±0.91 / 143.59 ms │        140.48 / 142.12 ±1.22 / 143.49 ms │     no change │
│ QQuery 34 │        105.56 / 107.74 ±1.39 / 109.46 ms │        106.30 / 107.63 ±1.07 / 108.83 ms │     no change │
│ QQuery 35 │        107.59 / 108.61 ±0.91 / 110.29 ms │        106.49 / 107.70 ±0.77 / 108.79 ms │     no change │
│ QQuery 36 │        220.18 / 224.71 ±2.83 / 228.60 ms │        212.24 / 218.44 ±3.72 / 223.57 ms │     no change │
│ QQuery 37 │        176.79 / 179.68 ±2.06 / 182.17 ms │        175.97 / 179.93 ±2.31 / 182.25 ms │     no change │
│ QQuery 38 │           84.41 / 88.35 ±5.16 / 98.22 ms │           83.70 / 87.27 ±2.66 / 91.54 ms │     no change │
│ QQuery 39 │        127.50 / 130.41 ±2.11 / 133.14 ms │        125.77 / 128.42 ±1.48 / 129.95 ms │     no change │
│ QQuery 40 │        114.11 / 119.77 ±6.32 / 131.40 ms │        108.85 / 115.48 ±5.44 / 125.47 ms │     no change │
│ QQuery 41 │           15.19 / 16.81 ±1.26 / 18.84 ms │           15.08 / 15.73 ±0.49 / 16.52 ms │ +1.07x faster │
│ QQuery 42 │        108.31 / 109.04 ±0.80 / 110.02 ms │        107.48 / 109.07 ±1.44 / 111.21 ms │     no change │
│ QQuery 43 │           83.92 / 84.72 ±0.60 / 85.38 ms │           83.87 / 84.79 ±0.85 / 86.14 ms │     no change │
│ QQuery 44 │           11.24 / 11.94 ±0.94 / 13.79 ms │           11.41 / 12.04 ±0.51 / 12.81 ms │     no change │
│ QQuery 45 │           52.71 / 54.41 ±1.85 / 57.94 ms │           53.53 / 55.60 ±1.43 / 57.42 ms │     no change │
│ QQuery 46 │        235.42 / 239.22 ±2.55 / 243.44 ms │        231.29 / 232.85 ±1.22 / 234.90 ms │     no change │
│ QQuery 47 │       676.09 / 724.14 ±35.38 / 754.61 ms │       703.15 / 730.76 ±23.09 / 772.31 ms │     no change │
│ QQuery 48 │        288.11 / 291.84 ±2.71 / 295.94 ms │        287.92 / 293.32 ±3.58 / 298.28 ms │     no change │
│ QQuery 49 │        255.55 / 256.95 ±0.94 / 258.16 ms │        253.07 / 254.63 ±0.93 / 255.84 ms │     no change │
│ QQuery 50 │        231.39 / 234.63 ±2.86 / 238.60 ms │        228.73 / 236.38 ±5.23 / 242.86 ms │     no change │
│ QQuery 51 │        180.51 / 184.74 ±2.86 / 189.13 ms │        184.26 / 186.37 ±1.88 / 189.19 ms │     no change │
│ QQuery 52 │        106.56 / 107.78 ±1.23 / 110.00 ms │        107.23 / 108.84 ±1.37 / 111.23 ms │     no change │
│ QQuery 53 │        101.27 / 102.03 ±0.50 / 102.75 ms │        103.75 / 104.16 ±0.55 / 105.25 ms │     no change │
│ QQuery 54 │        146.91 / 149.24 ±1.70 / 151.28 ms │        150.59 / 153.06 ±1.42 / 155.01 ms │     no change │
│ QQuery 55 │        106.90 / 108.38 ±1.42 / 110.91 ms │        107.59 / 108.69 ±0.67 / 109.36 ms │     no change │
│ QQuery 56 │        139.35 / 141.01 ±1.44 / 143.21 ms │        140.44 / 142.71 ±1.59 / 144.88 ms │     no change │
│ QQuery 57 │        170.63 / 173.93 ±2.19 / 176.76 ms │        175.58 / 177.89 ±1.78 / 180.80 ms │     no change │
│ QQuery 58 │        289.82 / 301.36 ±7.69 / 309.32 ms │        294.12 / 300.03 ±6.61 / 311.55 ms │     no change │
│ QQuery 59 │        197.54 / 201.15 ±4.30 / 209.31 ms │        201.75 / 204.75 ±2.16 / 207.71 ms │     no change │
│ QQuery 60 │        144.73 / 145.68 ±0.73 / 146.61 ms │        146.93 / 147.75 ±0.61 / 148.49 ms │     no change │
│ QQuery 61 │        170.82 / 173.12 ±2.05 / 176.88 ms │        173.30 / 175.90 ±1.79 / 177.98 ms │     no change │
│ QQuery 62 │       919.32 / 949.78 ±23.21 / 987.81 ms │      909.25 / 948.20 ±42.60 / 1019.00 ms │     no change │
│ QQuery 63 │        103.76 / 105.70 ±1.77 / 108.86 ms │        103.82 / 105.65 ±1.59 / 107.97 ms │     no change │
│ QQuery 64 │        688.08 / 697.38 ±6.21 / 705.52 ms │        682.14 / 694.22 ±6.61 / 701.47 ms │     no change │
│ QQuery 65 │        250.47 / 254.05 ±2.37 / 256.04 ms │        248.33 / 252.46 ±3.41 / 256.84 ms │     no change │
│ QQuery 66 │       230.07 / 250.27 ±15.84 / 272.44 ms │       243.41 / 254.84 ±11.40 / 275.64 ms │     no change │
│ QQuery 67 │       306.43 / 318.04 ±12.27 / 340.71 ms │        309.74 / 319.08 ±7.72 / 330.47 ms │     no change │
│ QQuery 68 │        273.88 / 279.55 ±4.45 / 286.64 ms │        277.09 / 280.21 ±3.51 / 286.94 ms │     no change │
│ QQuery 69 │        101.38 / 102.97 ±1.72 / 106.24 ms │        101.89 / 102.70 ±0.52 / 103.28 ms │     no change │
│ QQuery 70 │       333.02 / 349.83 ±10.07 / 363.99 ms │        333.75 / 342.74 ±9.10 / 357.45 ms │     no change │
│ QQuery 71 │        134.31 / 136.78 ±1.76 / 138.73 ms │        133.20 / 135.23 ±1.35 / 136.52 ms │     no change │
│ QQuery 72 │       699.74 / 715.60 ±10.75 / 730.88 ms │       687.69 / 714.78 ±21.49 / 752.66 ms │     no change │
│ QQuery 73 │        101.30 / 102.59 ±0.79 / 103.24 ms │        102.59 / 104.88 ±1.61 / 107.51 ms │     no change │
│ QQuery 74 │       599.73 / 621.03 ±13.82 / 636.34 ms │       566.83 / 588.93 ±19.55 / 623.92 ms │ +1.05x faster │
│ QQuery 75 │        274.38 / 280.53 ±3.51 / 285.03 ms │        276.89 / 279.25 ±1.93 / 282.32 ms │     no change │
│ QQuery 76 │        133.56 / 135.16 ±1.47 / 137.85 ms │        133.36 / 135.33 ±1.54 / 137.18 ms │     no change │
│ QQuery 77 │        191.66 / 193.58 ±1.51 / 195.66 ms │        188.04 / 188.89 ±0.64 / 189.92 ms │     no change │
│ QQuery 78 │        360.16 / 362.59 ±1.83 / 364.75 ms │        353.03 / 356.82 ±4.29 / 363.87 ms │     no change │
│ QQuery 79 │        234.29 / 245.46 ±5.99 / 250.10 ms │        244.54 / 248.19 ±1.95 / 250.02 ms │     no change │
│ QQuery 80 │        330.21 / 332.41 ±2.21 / 336.57 ms │        329.22 / 332.24 ±3.40 / 338.52 ms │     no change │
│ QQuery 81 │           27.76 / 28.39 ±0.66 / 29.58 ms │           27.05 / 28.32 ±1.02 / 29.41 ms │     no change │
│ QQuery 82 │        197.92 / 200.24 ±1.66 / 202.20 ms │        203.52 / 204.36 ±0.63 / 205.10 ms │     no change │
│ QQuery 83 │           39.16 / 40.24 ±0.76 / 41.35 ms │           40.51 / 42.66 ±1.83 / 45.93 ms │  1.06x slower │
│ QQuery 84 │           48.27 / 49.43 ±0.87 / 50.93 ms │           49.72 / 50.84 ±1.33 / 53.32 ms │     no change │
│ QQuery 85 │        146.69 / 149.45 ±1.84 / 152.10 ms │        147.45 / 149.58 ±1.65 / 151.44 ms │     no change │
│ QQuery 86 │           38.65 / 40.07 ±1.50 / 42.85 ms │           39.05 / 40.09 ±0.73 / 41.01 ms │     no change │
│ QQuery 87 │           87.85 / 89.33 ±1.28 / 91.52 ms │           86.23 / 88.41 ±2.48 / 93.22 ms │     no change │
│ QQuery 88 │          98.66 / 99.56 ±0.80 / 101.05 ms │          99.20 / 99.94 ±0.50 / 100.70 ms │     no change │
│ QQuery 89 │        117.49 / 118.70 ±0.89 / 119.85 ms │        117.78 / 119.69 ±1.36 / 122.02 ms │     no change │
│ QQuery 90 │           23.72 / 24.27 ±0.52 / 25.22 ms │           23.54 / 24.32 ±0.79 / 25.51 ms │     no change │
│ QQuery 91 │           63.01 / 64.59 ±0.99 / 65.44 ms │           64.12 / 65.05 ±0.70 / 65.98 ms │     no change │
│ QQuery 92 │           56.60 / 57.97 ±1.15 / 59.88 ms │           58.94 / 59.67 ±0.72 / 61.02 ms │     no change │
│ QQuery 93 │        190.70 / 192.77 ±1.37 / 194.49 ms │        195.39 / 196.83 ±1.22 / 198.66 ms │     no change │
│ QQuery 94 │           60.69 / 61.28 ±0.38 / 61.85 ms │           60.29 / 62.31 ±1.79 / 65.50 ms │     no change │
│ QQuery 95 │        133.95 / 135.97 ±1.70 / 138.59 ms │        134.70 / 136.40 ±0.96 / 137.32 ms │     no change │
│ QQuery 96 │           73.22 / 73.76 ±0.76 / 75.20 ms │           72.65 / 74.18 ±1.05 / 75.38 ms │     no change │
│ QQuery 97 │        130.29 / 131.18 ±0.96 / 133.00 ms │        129.29 / 132.21 ±1.53 / 133.54 ms │     no change │
│ QQuery 98 │        152.38 / 154.79 ±1.49 / 157.05 ms │        153.89 / 155.56 ±0.86 / 156.32 ms │     no change │
│ QQuery 99 │ 10762.32 / 10780.90 ±24.40 / 10829.13 ms │ 10754.40 / 10795.11 ±29.64 / 10833.55 ms │     no change │
└───────────┴──────────────────────────────────────────┴──────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                       │ 33613.11ms │
│ Total Time (topk-native-optimization)   │ 33776.38ms │
│ Average Time (HEAD)                     │   339.53ms │
│ Average Time (topk-native-optimization) │   341.18ms │
│ Queries Faster                          │          3 │
│ Queries Slower                          │          4 │
│ Queries with No Change                  │         92 │
│ Queries with Failure                    │          0 │
└─────────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 168.4s
Peak memory 5.5 GiB
Avg memory 4.5 GiB
CPU user 269.9s
CPU sys 17.6s
Disk read 0 B
Disk write 638.1 MiB

tpcds — branch

Metric Value
Wall time 169.2s
Peak memory 5.6 GiB
Avg memory 4.7 GiB
CPU user 272.9s
CPU sys 17.7s
Disk read 0 B
Disk write 160.0 KiB

File an issue against this benchmark runner

@Dandandan Dandandan closed this Apr 3, 2026
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.

2 participants