Skip to content

Actually preserve predicate execution order in PushDownFilter#21643

Open
joroKr21 wants to merge 1 commit intoapache:mainfrom
coralogix:bugfux/pushdown-filter-order
Open

Actually preserve predicate execution order in PushDownFilter#21643
joroKr21 wants to merge 1 commit intoapache:mainfrom
coralogix:bugfux/pushdown-filter-order

Conversation

@joroKr21
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

It just makes more sense - if the user knows that they want a particular filter before the others, let them do that. Also, the existing comments indicate that this was the original intention.

What changes are included in this PR?

The combined predicate of multiple filter plan nodes now preserves execution order.

Are these changes tested?

Yes, added unit tests.

Are there any user-facing changes?

Yes, execution order of predicates might change.

@github-actions github-actions bot added the optimizer Optimizer rules label Apr 15, 2026
@joroKr21 joroKr21 force-pushed the bugfux/pushdown-filter-order branch from e4bcab0 to b86f511 Compare April 15, 2026 15:34
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Apr 15, 2026
@joroKr21 joroKr21 force-pushed the bugfux/pushdown-filter-order branch 2 times, most recently from b5d6c25 to 336af3d Compare April 15, 2026 15:51
@Dandandan
Copy link
Copy Markdown
Contributor

run benchmark tpch10

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4253731652-1302-wx2jx 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 bugfux/pushdown-filter-order (336af3d) to f99ba69 (merge-base) diff using: tpch10
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 bugfux_pushdown-filter-order
--------------------
Benchmark tpch_sf10.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃                               HEAD ┃       bugfux_pushdown-filter-order ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1  │  368.92 / 370.34 ±1.25 / 372.42 ms │  368.94 / 370.80 ±1.50 / 373.16 ms │    no change │
│ QQuery 2  │  136.81 / 139.44 ±1.75 / 141.31 ms │  139.40 / 142.79 ±2.89 / 146.66 ms │    no change │
│ QQuery 3  │  298.48 / 300.32 ±2.24 / 304.71 ms │  295.46 / 300.74 ±5.61 / 309.38 ms │    no change │
│ QQuery 4  │  156.02 / 158.25 ±1.29 / 159.96 ms │  157.11 / 158.97 ±1.69 / 161.60 ms │    no change │
│ QQuery 5  │  447.98 / 453.75 ±4.67 / 460.39 ms │  441.03 / 448.44 ±7.29 / 461.18 ms │    no change │
│ QQuery 6  │  132.14 / 135.87 ±3.01 / 139.97 ms │  132.44 / 136.57 ±3.08 / 140.26 ms │    no change │
│ QQuery 7  │  569.75 / 577.58 ±6.51 / 585.63 ms │ 578.51 / 592.57 ±10.18 / 606.35 ms │    no change │
│ QQuery 8  │  479.79 / 486.15 ±4.57 / 491.95 ms │  474.19 / 481.70 ±7.52 / 494.90 ms │    no change │
│ QQuery 9  │ 679.30 / 691.16 ±10.51 / 708.92 ms │  687.93 / 698.04 ±6.78 / 708.74 ms │    no change │
│ QQuery 10 │  343.83 / 347.87 ±4.54 / 356.14 ms │  337.09 / 347.24 ±9.21 / 359.18 ms │    no change │
│ QQuery 11 │  107.89 / 112.30 ±3.26 / 117.33 ms │  108.23 / 111.43 ±3.02 / 115.49 ms │    no change │
│ QQuery 12 │  201.91 / 204.64 ±1.75 / 207.38 ms │  208.92 / 211.10 ±1.72 / 213.53 ms │    no change │
│ QQuery 13 │  307.81 / 316.02 ±6.13 / 324.10 ms │  321.64 / 333.87 ±9.25 / 344.13 ms │ 1.06x slower │
│ QQuery 14 │  180.98 / 183.59 ±1.97 / 185.52 ms │  181.01 / 183.33 ±2.09 / 187.10 ms │    no change │
│ QQuery 15 │  331.98 / 337.39 ±4.54 / 345.52 ms │  331.13 / 334.36 ±2.28 / 337.08 ms │    no change │
│ QQuery 16 │     86.34 / 87.74 ±1.13 / 89.39 ms │     83.70 / 87.60 ±2.92 / 91.10 ms │    no change │
│ QQuery 17 │  767.25 / 774.50 ±5.64 / 781.62 ms │  759.69 / 764.72 ±3.35 / 768.15 ms │    no change │
│ QQuery 18 │ 845.83 / 873.51 ±15.92 / 886.40 ms │ 871.59 / 886.61 ±12.64 / 907.89 ms │    no change │
│ QQuery 19 │  269.19 / 273.41 ±3.91 / 280.09 ms │  263.71 / 270.95 ±7.71 / 284.51 ms │    no change │
│ QQuery 20 │  324.55 / 329.66 ±3.49 / 334.58 ms │  317.62 / 328.83 ±6.15 / 334.53 ms │    no change │
│ QQuery 21 │ 855.04 / 864.75 ±11.45 / 884.59 ms │ 846.59 / 866.20 ±14.67 / 888.37 ms │    no change │
│ QQuery 22 │     83.49 / 84.75 ±1.25 / 87.14 ms │     79.22 / 84.22 ±2.87 / 88.10 ms │    no change │
└───────────┴────────────────────────────────────┴────────────────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                           ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 8103.01ms │
│ Total Time (bugfux_pushdown-filter-order)   │ 8141.07ms │
│ Average Time (HEAD)                         │  368.32ms │
│ Average Time (bugfux_pushdown-filter-order) │  370.05ms │
│ Queries Faster                              │         0 │
│ Queries Slower                              │         1 │
│ Queries with No Change                      │        21 │
│ Queries with Failure                        │         0 │
└─────────────────────────────────────────────┴───────────┘

Resource Usage

tpch10 — base (merge-base)

Metric Value
Wall time 40.9s
Peak memory 10.2 GiB
Avg memory 7.8 GiB
CPU user 430.9s
CPU sys 25.4s
Peak spill 0 B

tpch10 — branch

Metric Value
Wall time 41.1s
Peak memory 10.1 GiB
Avg memory 7.7 GiB
CPU user 432.8s
CPU sys 25.8s
Peak spill 0 B

File an issue against this benchmark runner

@joroKr21 joroKr21 mentioned this pull request Apr 16, 2026
1 task
@joroKr21 joroKr21 force-pushed the bugfux/pushdown-filter-order branch from 336af3d to 01fffb1 Compare April 16, 2026 07:12
@joroKr21
Copy link
Copy Markdown
Contributor Author

@Dandandan any idea what is this division by zero error in the tests?

@joroKr21 joroKr21 force-pushed the bugfux/pushdown-filter-order branch from 01fffb1 to 0e63f40 Compare April 16, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PushDownFilter claims to be preserving predicate order but in fact reverses it

3 participants