Skip to content

Push sort requirements through simple projections#23288

Open
aectaan wants to merge 1 commit into
apache:mainfrom
aectaan:push_sorts_through_simple_projections
Open

Push sort requirements through simple projections#23288
aectaan wants to merge 1 commit into
apache:mainfrom
aectaan:push_sorts_through_simple_projections

Conversation

@aectaan

@aectaan aectaan commented Jul 2, 2026

Copy link
Copy Markdown

Allow EnforceSorting sort pushdown to remap ordering requirements through ProjectionExec when the required output columns are simple aliases or reordered input columns.

Which issue does this PR close?

Prior this patch sort pushdown stopped at ProjectionExec, even when the projection only changed column order. This could force a SortExec above the projection and therefore above larger subplans such as UnionExec, preventing branch-local sorts from being used.

The new logic conservatively handles only column-to-column projections and leaves computed expressions untouched, preserving correctness while enabling better plans for reordered projection cases.

  • Closes #.

Are these changes tested?

Yes:

  • new test test_push_sort_through_reordered_projection_to_union added.
  • Existing tests are updated accordingly.

Are there any user-facing changes?

No

@github-actions github-actions Bot added optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jul 2, 2026
@xudong963

Copy link
Copy Markdown
Member

@zhuqi-lucas might have a look at the PR

@zhuqi-lucas

Copy link
Copy Markdown
Contributor

@xudong963 @alamb It seems duplicated with this:
#23199

@aectaan

aectaan commented Jul 3, 2026

Copy link
Copy Markdown
Author

@xudong963 @alamb It seems duplicated with this: #23199

I don't think so due to comment in mentioned PR.

@zhuqi-lucas

zhuqi-lucas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@xudong963 @alamb It seems duplicated with this: #23199

I don't think so due to comment in mentioned PR.

Ok, i will take a look this PR also, but something seems duplicated, i want to merge another first, then rebase this PR based on that.

#23199 is merged in progress, @aectaan you can rebased it.

@zhuqi-lucas zhuqi-lucas closed this Jul 3, 2026
@zhuqi-lucas zhuqi-lucas reopened this Jul 3, 2026
@aectaan aectaan force-pushed the push_sorts_through_simple_projections branch 3 times, most recently from 74089c8 to 0e75eea Compare July 3, 2026 08:37
@aectaan

aectaan commented Jul 3, 2026

Copy link
Copy Markdown
Author

@zhuqi-lucas thanks, rebased, updated missed tpch tests.

@Dandandan

Copy link
Copy Markdown
Contributor

This is nice - I think I found this earlier (but abandoned because it didn't move benchmarks).

I think it is a good change, it should reduce sort / memory usage somewhat.

@Dandandan

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-c4874451883-837-9w7px 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 push_sorts_through_simple_projections (0e75eea) to 31198ba (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4874451883-838-q7lcq 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 push_sorts_through_simple_projections (0e75eea) to 31198ba (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-c4874451883-839-vqshf 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 push_sorts_through_simple_projections (0e75eea) to 31198ba (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 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 push_sorts_through_simple_projections
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃ push_sorts_through_simple_projections ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 38.45 / 39.79 ±1.31 / 41.76 ms │        37.71 / 38.76 ±1.17 / 41.03 ms │ no change │
│ QQuery 2  │ 19.32 / 19.59 ±0.21 / 19.84 ms │        18.97 / 19.34 ±0.28 / 19.80 ms │ no change │
│ QQuery 3  │ 31.05 / 34.02 ±2.09 / 37.58 ms │        31.13 / 33.04 ±0.96 / 33.76 ms │ no change │
│ QQuery 4  │ 17.63 / 17.80 ±0.12 / 17.96 ms │        17.47 / 18.32 ±0.74 / 19.34 ms │ no change │
│ QQuery 5  │ 38.39 / 40.53 ±1.10 / 41.55 ms │        38.71 / 40.14 ±0.76 / 40.80 ms │ no change │
│ QQuery 6  │ 16.20 / 16.54 ±0.27 / 16.87 ms │        16.20 / 16.31 ±0.14 / 16.55 ms │ no change │
│ QQuery 7  │ 44.36 / 45.79 ±1.05 / 46.87 ms │        42.93 / 44.88 ±1.31 / 46.44 ms │ no change │
│ QQuery 8  │ 43.44 / 44.40 ±1.01 / 45.77 ms │        43.24 / 43.57 ±0.23 / 43.85 ms │ no change │
│ QQuery 9  │ 50.00 / 50.70 ±0.64 / 51.82 ms │        49.61 / 50.33 ±0.51 / 51.10 ms │ no change │
│ QQuery 10 │ 42.41 / 43.12 ±1.21 / 45.54 ms │        41.99 / 42.32 ±0.24 / 42.59 ms │ no change │
│ QQuery 11 │ 13.43 / 13.78 ±0.46 / 14.67 ms │        13.24 / 13.52 ±0.23 / 13.92 ms │ no change │
│ QQuery 12 │ 23.63 / 24.26 ±0.40 / 24.69 ms │        23.94 / 25.07 ±0.99 / 26.84 ms │ no change │
│ QQuery 13 │ 33.04 / 34.49 ±1.53 / 37.22 ms │        31.98 / 34.44 ±1.78 / 36.58 ms │ no change │
│ QQuery 14 │ 23.72 / 23.96 ±0.15 / 24.12 ms │        23.77 / 23.96 ±0.16 / 24.24 ms │ no change │
│ QQuery 15 │ 30.98 / 31.60 ±1.01 / 33.60 ms │        30.99 / 31.26 ±0.22 / 31.64 ms │ no change │
│ QQuery 16 │ 14.00 / 14.20 ±0.18 / 14.51 ms │        14.06 / 14.31 ±0.22 / 14.69 ms │ no change │
│ QQuery 17 │ 73.72 / 74.42 ±0.47 / 75.13 ms │        73.73 / 74.91 ±1.16 / 76.97 ms │ no change │
│ QQuery 18 │ 58.51 / 59.57 ±0.93 / 61.14 ms │        58.91 / 60.34 ±1.52 / 62.97 ms │ no change │
│ QQuery 19 │ 32.98 / 33.28 ±0.24 / 33.66 ms │        32.91 / 33.18 ±0.27 / 33.54 ms │ no change │
│ QQuery 20 │ 32.09 / 32.37 ±0.15 / 32.54 ms │        32.17 / 32.51 ±0.54 / 33.59 ms │ no change │
│ QQuery 21 │ 56.13 / 58.02 ±0.98 / 58.90 ms │        55.17 / 56.34 ±1.19 / 58.52 ms │ no change │
│ QQuery 22 │ 14.06 / 14.15 ±0.10 / 14.30 ms │        13.88 / 14.23 ±0.41 / 15.04 ms │ no change │
└───────────┴────────────────────────────────┴───────────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                                    ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                                    │ 766.40ms │
│ Total Time (push_sorts_through_simple_projections)   │ 761.08ms │
│ Average Time (HEAD)                                  │  34.84ms │
│ Average Time (push_sorts_through_simple_projections) │  34.59ms │
│ 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 511.0 MiB
CPU user 22.2s
CPU sys 1.6s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.2 GiB
Avg memory 519.4 MiB
CPU user 21.9s
CPU sys 1.7s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

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

Comparing HEAD and push_sorts_through_simple_projections
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃ push_sorts_through_simple_projections ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.70 / 6.19 ±0.92 / 8.03 ms │           5.78 / 6.25 ±0.87 / 7.99 ms │     no change │
│ QQuery 2  │        81.88 / 82.51 ±0.41 / 83.06 ms │        82.25 / 82.33 ±0.09 / 82.45 ms │     no change │
│ QQuery 3  │        29.61 / 30.09 ±0.28 / 30.42 ms │        29.35 / 29.90 ±0.32 / 30.31 ms │     no change │
│ QQuery 4  │     489.99 / 494.43 ±2.82 / 498.79 ms │     487.63 / 491.59 ±2.27 / 494.35 ms │     no change │
│ QQuery 5  │        52.22 / 52.55 ±0.23 / 52.93 ms │        52.10 / 52.39 ±0.28 / 52.93 ms │     no change │
│ QQuery 6  │        36.64 / 37.31 ±0.38 / 37.74 ms │        36.56 / 36.93 ±0.29 / 37.45 ms │     no change │
│ QQuery 7  │        95.52 / 96.40 ±0.54 / 97.23 ms │        94.99 / 95.77 ±0.44 / 96.15 ms │     no change │
│ QQuery 8  │        37.13 / 39.05 ±3.19 / 45.42 ms │        37.09 / 38.65 ±2.19 / 42.98 ms │     no change │
│ QQuery 9  │        53.93 / 55.84 ±1.09 / 56.87 ms │        52.61 / 54.60 ±1.78 / 57.59 ms │     no change │
│ QQuery 10 │        63.90 / 64.36 ±0.28 / 64.72 ms │        63.41 / 63.70 ±0.17 / 63.91 ms │     no change │
│ QQuery 11 │     299.00 / 306.05 ±5.68 / 315.29 ms │     299.57 / 303.76 ±2.23 / 305.98 ms │     no change │
│ QQuery 12 │        28.59 / 29.14 ±0.33 / 29.47 ms │        28.42 / 29.00 ±0.36 / 29.33 ms │     no change │
│ QQuery 13 │     119.67 / 120.65 ±1.20 / 122.97 ms │     118.97 / 120.99 ±2.09 / 124.74 ms │     no change │
│ QQuery 14 │     416.61 / 418.58 ±1.40 / 420.44 ms │     417.33 / 420.69 ±1.82 / 422.84 ms │     no change │
│ QQuery 15 │        57.49 / 58.79 ±0.68 / 59.46 ms │        57.86 / 58.35 ±0.30 / 58.72 ms │     no change │
│ QQuery 16 │           6.95 / 7.08 ±0.23 / 7.53 ms │           6.81 / 6.99 ±0.15 / 7.24 ms │     no change │
│ QQuery 17 │        81.08 / 81.46 ±0.38 / 81.96 ms │        80.60 / 81.38 ±0.62 / 82.38 ms │     no change │
│ QQuery 18 │     125.97 / 127.09 ±1.14 / 128.99 ms │     125.47 / 127.07 ±2.24 / 131.40 ms │     no change │
│ QQuery 19 │        42.08 / 42.28 ±0.19 / 42.60 ms │        42.11 / 42.68 ±0.44 / 43.44 ms │     no change │
│ QQuery 20 │        35.93 / 37.20 ±1.40 / 39.81 ms │        35.63 / 36.55 ±0.94 / 37.79 ms │     no change │
│ QQuery 21 │        17.40 / 17.89 ±0.43 / 18.59 ms │        17.55 / 17.75 ±0.18 / 18.09 ms │     no change │
│ QQuery 22 │        62.31 / 63.73 ±1.12 / 65.75 ms │        62.37 / 62.76 ±0.30 / 63.11 ms │     no change │
│ QQuery 23 │     348.05 / 350.56 ±1.37 / 351.99 ms │     349.20 / 351.24 ±1.67 / 353.38 ms │     no change │
│ QQuery 24 │     226.42 / 231.61 ±5.30 / 240.97 ms │     228.41 / 230.65 ±1.76 / 232.27 ms │     no change │
│ QQuery 25 │     110.43 / 112.00 ±0.99 / 113.48 ms │     111.49 / 112.24 ±0.71 / 113.51 ms │     no change │
│ QQuery 26 │        59.33 / 60.32 ±1.36 / 63.01 ms │        58.44 / 59.75 ±1.84 / 63.32 ms │     no change │
│ QQuery 27 │           6.42 / 6.59 ±0.19 / 6.94 ms │           6.42 / 6.54 ±0.14 / 6.83 ms │     no change │
│ QQuery 28 │        60.72 / 61.61 ±0.72 / 62.75 ms │        58.18 / 61.14 ±1.53 / 62.33 ms │     no change │
│ QQuery 29 │      97.78 / 100.55 ±2.53 / 104.73 ms │       98.29 / 99.94 ±1.53 / 102.04 ms │     no change │
│ QQuery 30 │        33.25 / 33.56 ±0.35 / 34.19 ms │        32.53 / 33.69 ±1.77 / 37.20 ms │     no change │
│ QQuery 31 │     112.46 / 112.94 ±0.31 / 113.26 ms │     112.44 / 113.51 ±1.24 / 115.93 ms │     no change │
│ QQuery 32 │        20.50 / 20.97 ±0.58 / 22.10 ms │        20.48 / 20.97 ±0.41 / 21.65 ms │     no change │
│ QQuery 33 │        38.09 / 38.72 ±0.58 / 39.72 ms │        38.39 / 40.15 ±1.62 / 42.90 ms │     no change │
│ QQuery 34 │         9.94 / 10.59 ±0.64 / 11.38 ms │        10.07 / 10.39 ±0.28 / 10.88 ms │     no change │
│ QQuery 35 │        72.90 / 74.30 ±1.05 / 76.03 ms │        72.85 / 74.13 ±1.29 / 76.54 ms │     no change │
│ QQuery 36 │           5.92 / 6.07 ±0.18 / 6.42 ms │           6.00 / 6.12 ±0.18 / 6.48 ms │     no change │
│ QQuery 37 │           7.00 / 7.14 ±0.12 / 7.30 ms │           7.08 / 7.16 ±0.07 / 7.28 ms │     no change │
│ QQuery 38 │        62.25 / 63.21 ±0.56 / 63.94 ms │        62.70 / 63.03 ±0.30 / 63.42 ms │     no change │
│ QQuery 39 │       90.96 / 93.76 ±3.78 / 101.13 ms │        91.21 / 92.08 ±0.53 / 92.89 ms │     no change │
│ QQuery 40 │        23.83 / 24.34 ±0.56 / 25.37 ms │        24.27 / 24.58 ±0.28 / 24.93 ms │     no change │
│ QQuery 41 │        11.85 / 11.95 ±0.14 / 12.23 ms │        11.61 / 11.90 ±0.27 / 12.41 ms │     no change │
│ QQuery 42 │        24.06 / 24.47 ±0.53 / 25.50 ms │        23.94 / 24.61 ±0.64 / 25.70 ms │     no change │
│ QQuery 43 │           5.23 / 5.30 ±0.13 / 5.56 ms │           5.26 / 5.35 ±0.12 / 5.59 ms │     no change │
│ QQuery 44 │          9.65 / 9.87 ±0.21 / 10.20 ms │          9.73 / 9.87 ±0.15 / 10.08 ms │     no change │
│ QQuery 45 │        39.31 / 39.78 ±0.59 / 40.93 ms │        38.52 / 39.17 ±0.44 / 39.71 ms │     no change │
│ QQuery 46 │        12.56 / 14.24 ±2.58 / 19.33 ms │        12.08 / 12.24 ±0.14 / 12.47 ms │ +1.16x faster │
│ QQuery 47 │     227.35 / 231.87 ±4.61 / 238.94 ms │     229.60 / 233.40 ±3.55 / 238.97 ms │     no change │
│ QQuery 48 │        97.26 / 97.60 ±0.28 / 98.02 ms │        97.58 / 98.44 ±0.83 / 99.89 ms │     no change │
│ QQuery 49 │        77.36 / 79.82 ±4.71 / 89.24 ms │        77.50 / 78.92 ±1.94 / 82.67 ms │     no change │
│ QQuery 50 │        59.53 / 60.02 ±0.47 / 60.84 ms │        60.22 / 61.22 ±1.04 / 63.16 ms │     no change │
│ QQuery 51 │        91.27 / 93.66 ±2.44 / 98.28 ms │        93.38 / 94.36 ±0.77 / 95.51 ms │     no change │
│ QQuery 52 │        23.90 / 24.28 ±0.43 / 25.10 ms │        24.24 / 24.61 ±0.38 / 25.36 ms │     no change │
│ QQuery 53 │        29.95 / 32.43 ±3.90 / 40.20 ms │        29.86 / 32.17 ±3.85 / 39.85 ms │     no change │
│ QQuery 54 │        56.35 / 57.20 ±0.63 / 57.98 ms │        56.58 / 57.93 ±0.97 / 59.32 ms │     no change │
│ QQuery 55 │        23.35 / 23.91 ±0.45 / 24.58 ms │        23.70 / 24.02 ±0.30 / 24.57 ms │     no change │
│ QQuery 56 │        39.22 / 39.75 ±0.43 / 40.36 ms │        39.94 / 40.26 ±0.32 / 40.86 ms │     no change │
│ QQuery 57 │     177.88 / 180.87 ±3.48 / 187.55 ms │     176.73 / 180.71 ±2.98 / 185.20 ms │     no change │
│ QQuery 58 │     116.46 / 117.02 ±0.51 / 117.66 ms │     117.03 / 118.64 ±1.86 / 122.00 ms │     no change │
│ QQuery 59 │     118.62 / 119.27 ±0.49 / 120.05 ms │     120.20 / 120.54 ±0.28 / 121.03 ms │     no change │
│ QQuery 60 │        39.82 / 40.24 ±0.32 / 40.77 ms │        39.63 / 40.45 ±0.46 / 41.06 ms │     no change │
│ QQuery 61 │        12.74 / 14.18 ±2.65 / 19.48 ms │        12.77 / 13.93 ±2.02 / 17.95 ms │     no change │
│ QQuery 62 │        46.41 / 46.96 ±0.45 / 47.66 ms │        46.30 / 47.25 ±0.87 / 48.84 ms │     no change │
│ QQuery 63 │        29.82 / 30.65 ±0.66 / 31.63 ms │        30.23 / 30.56 ±0.45 / 31.44 ms │     no change │
│ QQuery 64 │     414.68 / 417.79 ±2.53 / 421.51 ms │     413.32 / 416.13 ±2.61 / 420.40 ms │     no change │
│ QQuery 65 │     149.32 / 152.81 ±4.61 / 161.70 ms │     143.48 / 150.35 ±3.51 / 152.85 ms │     no change │
│ QQuery 66 │        79.59 / 80.25 ±0.46 / 81.00 ms │        80.52 / 81.48 ±0.87 / 82.99 ms │     no change │
│ QQuery 67 │     240.51 / 241.92 ±2.28 / 246.47 ms │     242.15 / 243.35 ±0.88 / 244.72 ms │     no change │
│ QQuery 68 │        12.04 / 12.24 ±0.18 / 12.56 ms │        12.15 / 12.35 ±0.21 / 12.72 ms │     no change │
│ QQuery 69 │        58.50 / 60.49 ±1.88 / 63.43 ms │        58.42 / 61.47 ±4.88 / 71.15 ms │     no change │
│ QQuery 70 │     105.56 / 108.07 ±1.95 / 111.02 ms │     106.55 / 108.91 ±2.54 / 113.74 ms │     no change │
│ QQuery 71 │        35.74 / 36.46 ±0.98 / 38.40 ms │        35.83 / 36.31 ±0.28 / 36.58 ms │     no change │
│ QQuery 72 │ 2115.24 / 2215.24 ±60.13 / 2274.41 ms │ 2111.55 / 2190.78 ±50.16 / 2250.63 ms │     no change │
│ QQuery 73 │          9.76 / 9.92 ±0.18 / 10.26 ms │          9.72 / 9.93 ±0.26 / 10.43 ms │     no change │
│ QQuery 74 │     168.40 / 171.44 ±1.60 / 172.96 ms │     169.74 / 171.19 ±2.27 / 175.70 ms │     no change │
│ QQuery 75 │     149.16 / 153.76 ±5.64 / 163.85 ms │     150.09 / 153.95 ±4.95 / 163.60 ms │     no change │
│ QQuery 76 │        35.76 / 36.27 ±0.57 / 37.26 ms │        35.78 / 36.01 ±0.21 / 36.35 ms │     no change │
│ QQuery 77 │        61.55 / 64.58 ±3.84 / 71.99 ms │        61.91 / 64.17 ±3.32 / 70.76 ms │     no change │
│ QQuery 78 │     195.64 / 202.89 ±6.26 / 213.84 ms │     197.83 / 205.26 ±6.27 / 214.78 ms │     no change │
│ QQuery 79 │        67.49 / 68.57 ±0.75 / 69.83 ms │        67.87 / 69.27 ±1.82 / 72.71 ms │     no change │
│ QQuery 80 │      99.01 / 100.50 ±1.73 / 103.85 ms │     100.01 / 101.07 ±0.65 / 101.92 ms │     no change │
│ QQuery 81 │        25.85 / 27.20 ±1.59 / 30.32 ms │        25.99 / 28.68 ±4.37 / 37.38 ms │  1.05x slower │
│ QQuery 82 │        16.56 / 17.03 ±0.36 / 17.39 ms │        16.83 / 18.00 ±1.66 / 21.25 ms │  1.06x slower │
│ QQuery 83 │        40.58 / 41.12 ±0.71 / 42.41 ms │        40.92 / 41.56 ±0.67 / 42.78 ms │     no change │
│ QQuery 84 │        30.63 / 30.89 ±0.32 / 31.50 ms │        30.61 / 30.95 ±0.32 / 31.54 ms │     no change │
│ QQuery 85 │     107.47 / 111.90 ±4.73 / 120.72 ms │     108.37 / 110.46 ±3.46 / 117.35 ms │     no change │
│ QQuery 86 │        25.04 / 25.84 ±0.65 / 26.45 ms │        25.90 / 26.68 ±0.79 / 28.06 ms │     no change │
│ QQuery 87 │        62.86 / 63.91 ±0.68 / 64.71 ms │        64.50 / 64.89 ±0.29 / 65.37 ms │     no change │
│ QQuery 88 │        63.28 / 63.80 ±0.61 / 65.00 ms │        63.77 / 64.08 ±0.19 / 64.35 ms │     no change │
│ QQuery 89 │        36.27 / 38.62 ±3.58 / 45.70 ms │        36.20 / 36.42 ±0.18 / 36.70 ms │ +1.06x faster │
│ QQuery 90 │        17.37 / 17.54 ±0.27 / 18.08 ms │        17.26 / 17.51 ±0.25 / 17.98 ms │     no change │
│ QQuery 91 │        47.41 / 47.78 ±0.37 / 48.31 ms │        46.52 / 47.08 ±0.45 / 47.60 ms │     no change │
│ QQuery 92 │        29.80 / 30.22 ±0.33 / 30.62 ms │        29.50 / 30.28 ±0.69 / 31.54 ms │     no change │
│ QQuery 93 │        50.15 / 51.72 ±1.09 / 53.54 ms │        51.13 / 51.51 ±0.29 / 51.99 ms │     no change │
│ QQuery 94 │        38.40 / 40.79 ±3.17 / 47.04 ms │        38.35 / 38.78 ±0.35 / 39.24 ms │     no change │
│ QQuery 95 │        82.50 / 84.92 ±2.26 / 89.15 ms │        82.92 / 84.20 ±0.96 / 85.59 ms │     no change │
│ QQuery 96 │        24.46 / 24.75 ±0.27 / 25.15 ms │        24.38 / 24.81 ±0.31 / 25.21 ms │     no change │
│ QQuery 97 │        46.66 / 47.15 ±0.26 / 47.42 ms │        46.68 / 47.46 ±0.53 / 48.09 ms │     no change │
│ QQuery 98 │        43.02 / 44.36 ±2.10 / 48.54 ms │        42.76 / 43.42 ±0.35 / 43.78 ms │     no change │
│ QQuery 99 │        70.09 / 71.26 ±1.06 / 73.16 ms │        70.86 / 73.22 ±2.40 / 77.06 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                    ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                    │ 10086.84ms │
│ Total Time (push_sorts_through_simple_projections)   │ 10059.90ms │
│ Average Time (HEAD)                                  │   101.89ms │
│ Average Time (push_sorts_through_simple_projections) │   101.62ms │
│ Queries Faster                                       │          2 │
│ Queries Slower                                       │          2 │
│ Queries with No Change                               │         95 │
│ Queries with Failure                                 │          0 │
└──────────────────────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

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

tpcds — branch

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

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

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

Comparing HEAD and push_sorts_through_simple_projections
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃  push_sorts_through_simple_projections ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.23 / 3.95 ±5.37 / 14.69 ms │           1.24 / 4.13 ±5.63 / 15.38 ms │     no change │
│ QQuery 1  │        12.39 / 12.66 ±0.14 / 12.79 ms │         12.65 / 12.87 ±0.15 / 13.10 ms │     no change │
│ QQuery 2  │        35.65 / 36.02 ±0.27 / 36.35 ms │         35.77 / 35.95 ±0.21 / 36.35 ms │     no change │
│ QQuery 3  │        30.97 / 31.40 ±0.46 / 32.24 ms │         30.79 / 31.08 ±0.19 / 31.28 ms │     no change │
│ QQuery 4  │     221.80 / 225.52 ±2.84 / 230.11 ms │      220.97 / 226.02 ±3.60 / 230.96 ms │     no change │
│ QQuery 5  │     273.27 / 275.05 ±1.64 / 277.63 ms │      269.15 / 271.46 ±1.54 / 273.28 ms │     no change │
│ QQuery 6  │           1.29 / 1.43 ±0.22 / 1.87 ms │            1.27 / 1.41 ±0.22 / 1.85 ms │     no change │
│ QQuery 7  │        13.49 / 13.69 ±0.16 / 13.97 ms │         13.61 / 13.69 ±0.09 / 13.83 ms │     no change │
│ QQuery 8  │     318.24 / 323.14 ±2.67 / 326.14 ms │      317.00 / 323.86 ±3.54 / 326.99 ms │     no change │
│ QQuery 9  │     453.30 / 457.77 ±4.45 / 465.95 ms │      449.52 / 457.95 ±5.56 / 465.81 ms │     no change │
│ QQuery 10 │        69.98 / 70.93 ±1.19 / 73.09 ms │         68.67 / 69.38 ±0.83 / 70.83 ms │     no change │
│ QQuery 11 │        81.39 / 82.46 ±0.95 / 84.15 ms │         79.88 / 81.20 ±0.99 / 82.91 ms │     no change │
│ QQuery 12 │     266.04 / 270.67 ±2.67 / 273.19 ms │      262.80 / 270.63 ±7.81 / 284.23 ms │     no change │
│ QQuery 13 │    362.97 / 379.93 ±13.80 / 400.72 ms │     384.96 / 409.54 ±19.26 / 437.94 ms │  1.08x slower │
│ QQuery 14 │    306.07 / 320.51 ±15.12 / 346.09 ms │      307.24 / 313.54 ±5.79 / 323.49 ms │     no change │
│ QQuery 15 │    306.26 / 320.93 ±12.84 / 343.72 ms │     270.87 / 287.89 ±12.78 / 301.27 ms │ +1.11x faster │
│ QQuery 16 │    616.52 / 628.28 ±15.06 / 656.62 ms │     607.39 / 621.43 ±17.28 / 654.31 ms │     no change │
│ QQuery 17 │     614.13 / 620.39 ±3.70 / 624.93 ms │     617.00 / 632.61 ±14.83 / 657.22 ms │     no change │
│ QQuery 18 │ 1254.79 / 1325.63 ±78.26 / 1447.86 ms │  1252.20 / 1312.82 ±47.18 / 1387.16 ms │     no change │
│ QQuery 19 │        29.57 / 30.79 ±2.21 / 35.20 ms │         28.99 / 29.16 ±0.17 / 29.41 ms │ +1.06x faster │
│ QQuery 20 │    520.70 / 536.98 ±13.03 / 552.47 ms │     522.30 / 551.29 ±24.91 / 592.37 ms │     no change │
│ QQuery 21 │     510.40 / 519.14 ±7.47 / 529.08 ms │      522.30 / 527.25 ±4.87 / 533.51 ms │     no change │
│ QQuery 22 │    979.95 / 992.50 ±8.86 / 1001.15 ms │      982.15 / 988.97 ±5.41 / 997.46 ms │     no change │
│ QQuery 23 │ 3052.72 / 3150.75 ±78.10 / 3287.92 ms │  3052.52 / 3130.78 ±72.17 / 3237.85 ms │     no change │
│ QQuery 24 │        41.36 / 45.86 ±5.12 / 54.49 ms │         41.10 / 44.81 ±6.47 / 57.71 ms │     no change │
│ QQuery 25 │    111.70 / 118.57 ±11.33 / 141.17 ms │     111.36 / 116.92 ±10.34 / 137.58 ms │     no change │
│ QQuery 26 │        41.55 / 43.15 ±1.86 / 46.59 ms │         41.44 / 43.48 ±2.34 / 48.02 ms │     no change │
│ QQuery 27 │    675.49 / 689.68 ±14.20 / 715.94 ms │      674.20 / 683.69 ±6.47 / 693.61 ms │     no change │
│ QQuery 28 │ 3031.72 / 3095.52 ±61.24 / 3200.97 ms │  3057.49 / 3127.71 ±63.87 / 3217.03 ms │     no change │
│ QQuery 29 │      42.29 / 59.94 ±33.86 / 127.65 ms │        41.07 / 47.64 ±12.33 / 72.28 ms │ +1.26x faster │
│ QQuery 30 │    310.23 / 330.17 ±11.91 / 341.85 ms │      296.99 / 305.62 ±9.56 / 319.83 ms │ +1.08x faster │
│ QQuery 31 │     291.98 / 295.10 ±3.10 / 300.96 ms │      281.39 / 292.38 ±8.80 / 306.72 ms │     no change │
│ QQuery 32 │   916.38 / 952.04 ±29.56 / 1004.12 ms │     908.21 / 940.29 ±27.11 / 981.97 ms │     no change │
│ QQuery 33 │ 1490.83 / 1581.37 ±63.10 / 1665.21 ms │ 1430.27 / 1594.84 ±140.75 / 1793.18 ms │     no change │
│ QQuery 34 │ 1477.32 / 1499.84 ±17.02 / 1524.57 ms │  1474.03 / 1527.55 ±46.79 / 1599.58 ms │     no change │
│ QQuery 35 │    277.36 / 310.40 ±26.79 / 346.08 ms │     278.84 / 301.89 ±20.81 / 331.89 ms │     no change │
│ QQuery 36 │        70.78 / 75.26 ±4.84 / 82.50 ms │         65.49 / 67.72 ±2.45 / 72.32 ms │ +1.11x faster │
│ QQuery 37 │        35.58 / 38.35 ±2.85 / 43.18 ms │         36.62 / 41.20 ±2.80 / 44.23 ms │  1.07x slower │
│ QQuery 38 │        40.17 / 44.52 ±4.28 / 52.63 ms │         42.98 / 47.18 ±4.40 / 55.62 ms │  1.06x slower │
│ QQuery 39 │    136.91 / 146.78 ±10.90 / 163.72 ms │     149.47 / 158.40 ±11.05 / 178.87 ms │  1.08x slower │
│ QQuery 40 │        13.85 / 14.33 ±0.47 / 15.06 ms │         14.70 / 15.28 ±0.51 / 16.19 ms │  1.07x slower │
│ QQuery 41 │        13.49 / 14.53 ±1.79 / 18.11 ms │         14.22 / 18.41 ±5.08 / 27.30 ms │  1.27x slower │
│ QQuery 42 │        12.94 / 13.18 ±0.32 / 13.80 ms │         13.93 / 14.13 ±0.15 / 14.39 ms │  1.07x slower │
└───────────┴───────────────────────────────────────┴────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                    ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                    │ 19999.13ms │
│ Total Time (push_sorts_through_simple_projections)   │ 19994.05ms │
│ Average Time (HEAD)                                  │   465.10ms │
│ Average Time (push_sorts_through_simple_projections) │   464.98ms │
│ Queries Faster                                       │          5 │
│ Queries Slower                                       │          7 │
│ Queries with No Change                               │         31 │
│ Queries with Failure                                 │          0 │
└──────────────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 105.0s
Peak memory 10.8 GiB
Avg memory 4.0 GiB
CPU user 1028.7s
CPU sys 72.1s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 105.0s
Peak memory 11.8 GiB
Avg memory 4.3 GiB
CPU user 1019.5s
CPU sys 72.9s
Peak spill 0 B

File an issue against this benchmark runner

/// The implementation is intentionally conservative: computed projection
/// expressions and non-column sort expressions are not pushed down. Returning
/// `Ok(None)` leaves sorting above the projection, preserving correctness.
fn handle_projection_pushdown(

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.

It seems remap_requirement_through_projection in #23199 does a similar thing — can we deduplicate them?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, but it's more permissive. It filters out all the expressions that are not Column's. This one don't go if any expression is not Column.

I reused remap_requirement_through_projection inside the handle_projection_pushdown.

handle_projection_pushdown just adds additional check layer

@aectaan aectaan force-pushed the push_sorts_through_simple_projections branch from 0e75eea to 6bc7194 Compare July 3, 2026 13:44
@aectaan aectaan requested a review from zhuqi-lucas July 3, 2026 13:48
@aectaan aectaan force-pushed the push_sorts_through_simple_projections branch from 6bc7194 to 01fb7a2 Compare July 3, 2026 14:02
} else if let Some(aggregate_exec) = plan.downcast_ref::<AggregateExec>() {
handle_aggregate_pushdown(aggregate_exec, parent_required)
} else if let Some(projection_exec) = plan.downcast_ref::<ProjectionExec>() {
// A `ProjectionExec` with a fetch is handled in the fetch branch above

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.

The comments here is not easy to understanding, we may polish it or move to other places.

A ProjectionExec with a fetch is handled in the fetch branch above

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It came from recently merged #23199. What do you suggest? I think about removing it at all

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.

Yeah, remove it — the "handled in fetch branch above" note was informative at the old short-circuit line (which this PR removes), but here it's noise. Move the "column-only" rationale into handle_projection_pushdown's doc comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

}

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

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.

Test coverage is currently thin (one Union scenario); a few negative /alias / fetch-interaction cases would help.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, added new cases

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

Thank you for opening this pull request!

Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).

Details
     Cloning apache/main
    Building datafusion v54.0.0 (current)
       Built [ 103.414s] (current)
     Parsing datafusion v54.0.0 (current)
      Parsed [   0.034s] (current)
error: running 'cargo update' on crate 'datafusion' failed with output:
-----
    Updating crates.io index
error: failed to get `indexmap` as a dependency of package `datafusion v54.0.0 (/home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/25a6c1791b40a8c5aee886e0d85eb7da48b2aad2/datafusion/core)`
    ... which satisfies path dependency `datafusion` of package `placeholder v0.0.0 (/home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/local-datafusion-54_0_0-x86_64_unknown_linux_gnu-b870d5604f72f9ae)`

Caused by:
  failed to load source for dependency `indexmap`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of in/de/indexmap failed

Caused by:
  curl failed

Caused by:
  [16] Error in the HTTP2 framing layer

-----
error: failed to update dependencies for crate datafusion v54.0.0
note: this is unlikely to be a bug in cargo-semver-checks,
      and is probably an issue with the crate's Cargo.toml
note: the following command can be used to reproduce the compilation error:
      cargo new --lib example &&
          cd example &&
          echo '[workspace]' >> Cargo.toml &&
          cargo add --path /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/25a6c1791b40a8c5aee886e0d85eb7da48b2aad2/datafusion/core --features array_expressions,avro,backtrace,bzip2,compression,crypto_expressions,datafusion-datasource-avro,datafusion-datasource-parquet,datafusion-functions-nested,datafusion-sql,datetime_expressions,default,encoding_expressions,extended_tests,flate2,force_hash_collisions,liblzma,math_expressions,nested_expressions,parquet,parquet_encryption,recursive_protection,regex_expressions,serde,sql,sqlparser,string_expressions,unicode_expressions,zstd &&
          cargo update

    Building datafusion-physical-optimizer v54.0.0 (current)
       Built [  38.042s] (current)
     Parsing datafusion-physical-optimizer v54.0.0 (current)
      Parsed [   0.021s] (current)
    Building datafusion-physical-optimizer v54.0.0 (baseline)
       Built [  38.082s] (baseline)
     Parsing datafusion-physical-optimizer v54.0.0 (baseline)
      Parsed [   0.028s] (baseline)
    Checking datafusion-physical-optimizer v54.0.0 -> v54.0.0 (no change; assume patch)
     Checked [   0.118s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [  77.898s] datafusion-physical-optimizer
    Building datafusion-sqllogictest v54.0.0 (current)
       Built [ 176.089s] (current)
     Parsing datafusion-sqllogictest v54.0.0 (current)
      Parsed [   0.021s] (current)
    Building datafusion-sqllogictest v54.0.0 (baseline)
       Built [ 176.597s] (baseline)
     Parsing datafusion-sqllogictest v54.0.0 (baseline)
      Parsed [   0.023s] (baseline)
    Checking datafusion-sqllogictest v54.0.0 -> v54.0.0 (no change; assume patch)
     Checked [   0.087s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [ 355.649s] datafusion-sqllogictest
error: aborting due to failure to run 'cargo update' for crate datafusion v54.0.0

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Jul 4, 2026
Allow EnforceSorting sort pushdown to remap ordering requirements through
ProjectionExec when the required output columns are simple aliases or reordered
input columns.

Prior this patch sort pushdown stopped at `ProjectionExec`, even when the projection
only changed column order. This could force a `SortExec` above the projection and
therefore above larger subplans such as `UnionExec`, preventing branch-local sorts
from being used.

The new logic conservatively handles only column-to-column projections and leaves
computed expressions untouched, preserving correctness while enabling better
plans for reordered projection cases.
@aectaan aectaan force-pushed the push_sorts_through_simple_projections branch from 01fb7a2 to 014d165 Compare July 4, 2026 15:03
@aectaan aectaan requested a review from zhuqi-lucas July 4, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto detected api change Auto detected API change core Core DataFusion crate optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants