Skip to content

fix: short-circuit AND per row for volatile expressions and on errors - #27302

Open
rluvaton wants to merge 12 commits into
apache:mainfrom
rluvaton:short-circut-and-or-not-case-when-coalesce
Open

rluvaton wants to merge 12 commits into
apache:mainfrom
rluvaton:short-circut-and-or-not-case-when-coalesce

Conversation

@rluvaton

@rluvaton rluvaton commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

OR was done in #27471, this PR is the AND part.

Which issue does this PR close?

Rationale for this change

AND only filters out the rows earlier conjuncts already decided when few rows are left (PRE_SELECTION_THRESHOLD) and the conjunct is not just a column. Otherwise the conjunct runs on the whole batch, so:

  • x != 0 AND 1 / x > 1 can fail with division by zero, depending on how many rows match
  • volatile expressions run on rows they shouldn't

What changes are included in this PR?

Same rules as #27471, for AND:

  • Volatile conjunct: always evaluated only on the undecided rows
  • Deterministic conjunct: keeps the current heuristic, but if evaluating it fails, retry on the undecided rows only

Volatility is computed once in BinaryExpr::new for both AND and OR (it was only the right side for OR). AND needs the left side too, because nested ANDs are flattened and each conjunct's volatility is stored on its parent.

What is the testing strategy for this PR?

  • Unit tests in binary.rs (short_circuit module) for AND, nested AND and nullable left side, across selectivities on both sides of the threshold
  • Updated the select.slt AND query that was expected to fail with division by zero
  • volatile_evaluations.slt: BETWEEN now evaluates the volatile call 18 times instead of 20, since x <= high only runs on the rows where x >= low
  • Benchmarks for a nullable left side and a volatile right side are tracked in Add short_circuit benchmarks for nullable left side and volatile right side #27671

Are there any user-facing changes?

Best effort: AND evaluates a conjunct only on the rows that still need it when the conjunct is volatile, or when evaluating it on all rows fails.

When the physical expression is built and evaluated directly, x != 0 AND 1 / x > 1 no longer fails. In a query the optimizer may reorder conjuncts first, so use CASE when a guard is required (see the upgrade guide).

@github-actions github-actions Bot added physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt) labels Nov 10, 2026
@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark binary_op

@adriangbot

Copy link
Copy Markdown

Benchmark for this request failed before finishing (Kubernetes reason: BackoffLimitExceeded).

Benchmarks requested: binary_op

Runner log (last 40 lines)
2026-11-10T12:55:13.764091Z  INFO runner starting benchmark runner bench_type=Datafusion, pr_url=https://github.com/apache/datafusion/pull/27302, benchmarks=binary_op
2026-11-10T12:55:13.822418Z  INFO benchmark_controller::runner::bench_datafusion === Cloning PR branch ===
2026-11-10T12:55:13.822443Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["clone", "--depth=200", "https://github.com/apache/datafusion.git", "/workspace/datafusion-branch"], cwd="/"
2026-11-10T12:55:18.831792Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["fetch", "origin", "refs/pull/27302/head:short-circut-and-or-not-case-when-coalesce", "main"], cwd="/workspace/datafusion-branch"
2026-11-10T12:55:38.836693Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["checkout", "short-circut-and-or-not-case-when-coalesce"], cwd="/workspace/datafusion-branch"
2026-11-10T12:55:43.839106Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["merge-base", "HEAD", "origin/main"], cwd="/workspace/datafusion-branch"
2026-11-10T12:55:48.840882Z ERROR runner benchmark failed error=git merge-base: git merge-base HEAD origin/main exited with code 1
stdout:

stderr:
Kubernetes message
Job has reached the specified backoff limit

File an issue against this benchmark runner

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark binary_op

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c6768070438-4743-pnn5c 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (0ee36d2) to 9e0a08f (merge-base) diff

Run configuration
run benchmark binary_op

Results will be posted here when complete


File an issue against this benchmark runner

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark binary_op

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c6768295552-4744-n4jrn 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1f9b6c6) to 9e0a08f (merge-base) diff

Run configuration
run benchmark binary_op

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

This comment was marked as outdated.

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

Comparing short-circut-and-or-not-case-when-coalesce (1f9b6c6) to 9e0a08f (merge-base) diff

Run configuration
run benchmark binary_op
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

group                                               HEAD                                   short-circut-and-or-not-case-when-coalesce
-----                                               ----                                   ------------------------------------------
conjunction/k16_p0.7_w0/left_deep                   1.00     32.3±0.06µs        ? ?/sec    1.02     32.9±0.04µs        ? ?/sec
conjunction/k16_p0.7_w0/right_deep                  1.00     32.4±0.06µs        ? ?/sec    1.01     32.8±0.04µs        ? ?/sec
conjunction/k16_p0.7_w32/left_deep                  1.00     32.3±0.09µs        ? ?/sec    1.01     32.8±0.03µs        ? ?/sec
conjunction/k16_p0.7_w32/right_deep                 1.00     32.3±0.05µs        ? ?/sec    1.02     33.0±0.04µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w0/left_deep        1.02    361.2±2.21µs        ? ?/sec    1.00    354.2±3.34µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w0/right_deep       1.02    361.6±2.01µs        ? ?/sec    1.00    356.0±3.97µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w32/left_deep       1.01    439.6±8.22µs        ? ?/sec    1.00   434.4±11.17µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w32/right_deep      1.02    444.5±4.86µs        ? ?/sec    1.00    436.0±7.82µs        ? ?/sec
conjunction/k4_p0.5_w0/left_deep                    1.00      7.9±0.01µs        ? ?/sec    1.02      8.0±0.01µs        ? ?/sec
conjunction/k4_p0.5_w0/right_deep                   1.00      7.9±0.01µs        ? ?/sec    1.01      8.0±0.01µs        ? ?/sec
conjunction/k4_p0.5_w32/left_deep                   1.00      7.9±0.01µs        ? ?/sec    1.02      8.0±0.01µs        ? ?/sec
conjunction/k4_p0.5_w32/right_deep                  1.00      7.9±0.01µs        ? ?/sec    1.01      8.0±0.01µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w0/left_deep      1.00    331.2±1.43µs        ? ?/sec    1.00    331.9±2.03µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w0/right_deep     1.01    331.6±1.46µs        ? ?/sec    1.00    329.9±3.17µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w32/left_deep     1.00    403.2±3.90µs        ? ?/sec    1.01    407.9±5.31µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w32/right_deep    1.00    399.0±3.43µs        ? ?/sec    1.01    401.8±6.20µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w0/left_deep            1.00     16.1±0.02µs        ? ?/sec    1.02     16.4±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w0/right_deep           1.00     16.1±0.02µs        ? ?/sec    1.02     16.4±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w32/left_deep           1.00     16.0±0.02µs        ? ?/sec    1.02     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w32/right_deep          1.00     16.0±0.03µs        ? ?/sec    1.02     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.7_cast_w0/left_deep               1.00     23.6±0.03µs        ? ?/sec    1.02     24.0±0.03µs        ? ?/sec
conjunction/k8_p0.7_cast_w0/right_deep              1.00     23.5±0.03µs        ? ?/sec    1.01     23.8±0.02µs        ? ?/sec
conjunction/k8_p0.7_cast_w32/left_deep              1.00     24.3±0.06µs        ? ?/sec    1.07     26.1±0.03µs        ? ?/sec
conjunction/k8_p0.7_cast_w32/right_deep             1.00     23.6±0.05µs        ? ?/sec    1.01     23.9±0.03µs        ? ?/sec
conjunction/k8_p0.7_inlist_w0/left_deep             1.00     37.5±0.03µs        ? ?/sec    1.01     37.8±0.03µs        ? ?/sec
conjunction/k8_p0.7_inlist_w0/right_deep            1.00     37.5±0.03µs        ? ?/sec    1.01     37.9±0.11µs        ? ?/sec
conjunction/k8_p0.7_inlist_w32/left_deep            1.00     37.5±0.02µs        ? ?/sec    1.01     38.0±0.10µs        ? ?/sec
conjunction/k8_p0.7_inlist_w32/right_deep           1.00     37.5±0.03µs        ? ?/sec    1.01     37.8±0.03µs        ? ?/sec
conjunction/k8_p0.7_plus_w0/left_deep               1.00     22.8±0.03µs        ? ?/sec    1.01     23.1±0.02µs        ? ?/sec
conjunction/k8_p0.7_plus_w0/right_deep              1.00     22.8±0.03µs        ? ?/sec    1.01     23.1±0.02µs        ? ?/sec
conjunction/k8_p0.7_plus_w32/left_deep              1.01     23.3±0.05µs        ? ?/sec    1.00     23.1±0.09µs        ? ?/sec
conjunction/k8_p0.7_plus_w32/right_deep             1.00     22.8±0.04µs        ? ?/sec    1.01     23.0±0.02µs        ? ?/sec
conjunction/k8_p0.7_regex_w0/left_deep              1.00    339.7±2.44µs        ? ?/sec    1.01    341.4±3.13µs        ? ?/sec
conjunction/k8_p0.7_regex_w0/right_deep             1.00    337.9±3.04µs        ? ?/sec    1.00    338.8±2.82µs        ? ?/sec
conjunction/k8_p0.7_regex_w32/left_deep             1.00    415.2±4.31µs        ? ?/sec    1.01    417.5±8.11µs        ? ?/sec
conjunction/k8_p0.7_regex_w32/right_deep            1.00    415.3±6.06µs        ? ?/sec    1.01    420.1±6.42µs        ? ?/sec
conjunction/k8_p0.7_w0/left_deep                    1.00     16.0±0.03µs        ? ?/sec    1.02     16.2±0.03µs        ? ?/sec
conjunction/k8_p0.7_w0/right_deep                   1.00     16.1±0.03µs        ? ?/sec    1.01     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.7_w32/left_deep                   1.00     16.0±0.06µs        ? ?/sec    1.01     16.2±0.02µs        ? ?/sec
conjunction/k8_p0.7_w32/right_deep                  1.00     16.0±0.03µs        ? ?/sec    1.02     16.3±0.04µs        ? ?/sec
conjunction/k8_p0.9_w0/left_deep                    1.00     15.9±0.05µs        ? ?/sec    1.01     16.1±0.02µs        ? ?/sec
conjunction/k8_p0.9_w0/right_deep                   1.00     15.9±0.04µs        ? ?/sec    1.01     16.1±0.02µs        ? ?/sec
conjunction/k8_p0.9_w32/left_deep                   1.00     15.9±0.02µs        ? ?/sec    1.01     16.1±0.02µs        ? ?/sec
conjunction/k8_p0.9_w32/right_deep                  1.00     15.9±0.02µs        ? ?/sec    1.02     16.1±0.03µs        ? ?/sec
date32_subtract/20_percent_nulls                    1.00   1105.5±4.75ns        ? ?/sec    1.01   1116.4±3.59ns        ? ?/sec
date32_subtract/no_nulls                            1.00    969.7±3.14ns        ? ?/sec    1.00    965.4±5.11ns        ? ?/sec
date64_subtract/20_percent_nulls                    1.00      6.2±0.00µs        ? ?/sec    1.01      6.2±0.01µs        ? ?/sec
date64_subtract/no_nulls                            1.00      6.0±0.01µs        ? ?/sec    1.01      6.1±0.01µs        ? ?/sec
short_circuit/and/all_false                         1.00     64.8±0.86ns        ? ?/sec    1.06     68.7±1.02ns        ? ?/sec
short_circuit/and/all_true_in_and                   1.00    702.9±3.24µs        ? ?/sec    1.01    707.1±3.87µs        ? ?/sec
short_circuit/and/one_true_first                    1.00    298.6±0.67µs        ? ?/sec    1.01    301.0±1.31µs        ? ?/sec
short_circuit/and/one_true_last                     1.00    267.5±0.84µs        ? ?/sec    1.01    270.2±1.44µs        ? ?/sec
short_circuit/and/one_true_middle                   1.00    268.6±0.77µs        ? ?/sec    1.00    269.3±0.84µs        ? ?/sec
short_circuit/and/one_true_middle_left              1.00    265.1±0.79µs        ? ?/sec    1.00    264.8±1.04µs        ? ?/sec
short_circuit/and/one_true_middle_right             1.00    268.7±0.63µs        ? ?/sec    1.01    270.7±0.91µs        ? ?/sec
short_circuit/or/all_false_in_or                    1.00    699.2±3.28µs        ? ?/sec    1.01    707.5±3.24µs        ? ?/sec
short_circuit/or/all_true                           1.01     69.3±0.30ns        ? ?/sec    1.00     69.0±0.43ns        ? ?/sec
short_circuit/or/one_false_first                    1.00    269.8±0.69µs        ? ?/sec    1.01    273.0±1.41µs        ? ?/sec
short_circuit/or/one_false_last                     1.00    294.2±0.77µs        ? ?/sec    1.02    301.4±1.45µs        ? ?/sec
short_circuit/or/one_false_middle                   1.00    294.7±0.83µs        ? ?/sec    1.02    299.5±0.99µs        ? ?/sec
short_circuit/or/one_false_middle_left              1.00    290.1±0.82µs        ? ?/sec    1.02    295.4±0.71µs        ? ?/sec
short_circuit/or/one_false_middle_right             1.00    294.8±0.68µs        ? ?/sec    1.02    300.1±0.69µs        ? ?/sec

Resource Usage

binary_op — base (merge-base)

Metric Value
Wall time 700.2s
Peak memory 87.1 MiB
Avg memory 71.8 MiB
CPU user 781.4s
CPU sys 0.7s
Peak spill 0 B

binary_op — branch

Metric Value
Wall time 730.2s
Peak memory 84.3 MiB
Avg memory 66.2 MiB
CPU user 775.0s
CPU sys 0.7s
Peak spill 0 B

File an issue against this benchmark runner


// Check if we can apply short-circuit evaluation.
match check_short_circuit(&lhs, &self.op) {
match check_short_circuit(&lhs, &self.op, || self.children_volatility().right) {

@EmilyMatt EmilyMatt Nov 10, 2026 •

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.

just init the oncelock don't pass a closure

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

BinaryExpression is used in many operators, Eq, NotEq, Lt, Divide, Mul, etc... so no need to calculate that for everything

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's just very small, and will only happen once, I really don't see a reason for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed to be cached in new

) -> Result<ColumnarValue> {
// Use `filter_record_batch` directly because `evaluate_selection`
// scatters the RHS back to the original batch length.
let selection_batch = filter_record_batch(batch, mask)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this be made to only use the required columns? wide batches can pay a huge cost here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, already started it in a different pr, they are not dependent however

/// Lazily computed on first use, so walking the children is not repeated
/// for every batch. Children never change after construction, and every
/// constructor starts with an empty cache, so it never goes stale.
children_volatility: OnceLock<ChildrenVolatility>,

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.

Not convinced this is worth it.
I get that reoptimization etc, but this feels like a small price.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this physical expression is not only for AND and OR, but many many Binary Expr so adding the calculation for volatility in every one is not needed

also running many optimization before this actually needed will cause the entire expression tree every time while only needed for actual evaluation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed to Option and only evaluate for AND and OR

fn check_short_circuit(
lhs: &ColumnarValue,
op: &Operator,
rhs_is_volatile: impl FnOnce() -> bool,

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.

as mentioned, just make this a bool

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

commented in the other review comment


fn children_volatility(&self) -> ChildrenVolatility {
*self.children_volatility.get_or_init(|| ChildrenVolatility {
left: is_volatile(&self.left),

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.

Why is left needed?
in nested cases, each one will handle it for itself, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nested ANDs don't each handle it themselves: evaluate_conjunction flattens the whole chain and the top node evaluates every conjunct, so the inner AND's evaluate never runs. In x AND (v AND y), v is evaluated after x has decided some rows, and whether to pre-select it depends on v's volatility, which is the inner AND's left. OR isn't flattened, so for OR only right matters.

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 shape from this answer, x AND (v AND y) with a volatile v, has no test: every probe is the innermost right child. That leaves the cached left flag untested, and with this PR OR depends on it too. Before, OR walked its whole right side with is_volatile, so x OR (v AND y) was covered by construction. Now it reads the inner AND's cached left. Each of these would pass the current tests:

  • left: false in BinaryExpr::new
  • v.right instead of v.left || v.right in subtree_is_volatile
  • false instead of binary.left_is_volatile() in for_each_conjunct

A nested_and_volatile_* variant with the probe on the inner left, and(col_1_lt(s), and(probe, col_1_gt_eq(s / 2.0))), plus one OR over AND, or(col_1_gt_eq(s), and(probe, col_1_lt(s / 2.0))), would pin all three.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added both tests, each of the three changes now fails at least one of them

}

/// Whether the left child (or anything under it) is volatile
fn left_is_volatile(&self) -> bool {

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.

when can this ever be needed? if we already set it in new

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

children_volatility is an option, so we have this just to be safe that if for some reason this was called when it was not an option

}

/// Whether the right child (or anything under it) is volatile
fn right_is_volatile(&self) -> bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

likewise

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if *op != Operator::Or || lhs.data_type() != DataType::Boolean {
return None;
}
let ColumnarValue::Array(array) = lhs else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment that Scalars were already handled

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added assertion for getting true and comment

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark binary_op

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmarks

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c6795168036-4785-dc5q8 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1c26c64) to 9e0a08f (merge-base) diff

Run configuration
run benchmark 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-c6795168036-4784-fkprn 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1c26c64) to 9e0a08f (merge-base) diff

Run configuration
run benchmark tpcds

Results will be posted here when complete


File an issue against this benchmark runner

@comphead

Copy link
Copy Markdown
Contributor

Thanks @rluvaton thats a nice initiative, just wondering if that makes sense to split the PR into 2 and address AND/OR separately?

@rluvaton

Copy link
Copy Markdown
Member Author

@comphead, Extracted OR to:

once that merge will update this to only have AND

can you please review?

github-merge-queue Bot pushed a commit that referenced this pull request Nov 23, 2026
…27471)

Extracted from:
- #27302

as requested by @comphead 

## Which issue does this PR close?

- Related to #8927.

## Rationale for this change

`OR` only skip the right side for rows the left side already decided
when few rows are left (`PRE_SELECTION_THRESHOLD`). Otherwise the right
side runs on the whole batch, so:

- `x = 0 OR 1 / x > 1` can fail with division by zero, depending on how
many rows match
- volatile expressions run on rows they shouldn't
- `OR` doesn't short-circuit at all when the left side has any `NULL`

## What changes are included in this PR?

- Volatile right side: always evaluated only on the undecided rows
- Deterministic right side: keeps the current heuristic, but if
evaluating on the whole batch fails, retry on the undecided rows only
- `OR` handles `NULL` on the left side per row instead of giving up on
the whole batch

`AND` doesn't follow these rules yet, #27302 does the same for it. The
one difference left after that is that `AND` skips filtering when the
conjunct is just a column, aligning that can be a follow-up.

## What is the testing strategy for this PR?

- Unit tests in `binary.rs` (`short_circuit` module) for `OR`, nested
`OR` and nullable left side, across selectivities on both sides of the
threshold
- Updated `select.slt` queries that were expected to fail with division
by zero

## Are there any user-facing changes?

Queries like `x = 0 OR 1 / x > 1` no longer fail.


-------

Follow up:
- add benchmarks for:
	- LHS have NULLs, <= 20% of rows undecided
	- Volatile RHS, 90% undecided
…-not-case-when-coalesce

# Conflicts:
#	datafusion/physical-expr/src/expressions/binary.rs
#	datafusion/sqllogictest/test_files/select.slt
@rluvaton rluvaton changed the title fix: short-circuit AND/OR per row for volatile expressions and on errors fix: short-circuit AND per row for volatile expressions and on errors Nov 23, 2026
@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark binary_op

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmarks

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c7097028432-5624-d4rdn 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark binary_op

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-c7097053332-5626-mkmh2 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark 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-c7097053332-5625-2bg2n 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark 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-c7097053332-5627-78fcz 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark 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)

Comparing short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark tpch
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 short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃     HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 41.04 ms │                                   40.59 ms │ no change │
│ QQuery 2  │ 18.62 ms │                                   18.57 ms │ no change │
│ QQuery 3  │ 28.82 ms │                                   28.46 ms │ no change │
│ QQuery 4  │ 17.61 ms │                                   17.60 ms │ no change │
│ QQuery 5  │ 36.16 ms │                                   35.92 ms │ no change │
│ QQuery 6  │ 13.96 ms │                                   13.91 ms │ no change │
│ QQuery 7  │ 40.89 ms │                                   40.81 ms │ no change │
│ QQuery 8  │ 40.64 ms │                                   40.53 ms │ no change │
│ QQuery 9  │ 49.62 ms │                                   49.22 ms │ no change │
│ QQuery 10 │ 40.88 ms │                                   40.42 ms │ no change │
│ QQuery 11 │ 13.85 ms │                                   13.66 ms │ no change │
│ QQuery 12 │ 17.84 ms │                                   17.93 ms │ no change │
│ QQuery 13 │ 40.39 ms │                                   39.88 ms │ no change │
│ QQuery 14 │ 24.53 ms │                                   24.23 ms │ no change │
│ QQuery 15 │ 31.45 ms │                                   31.07 ms │ no change │
│ QQuery 16 │ 13.63 ms │                                   13.56 ms │ no change │
│ QQuery 17 │ 69.37 ms │                                   69.61 ms │ no change │
│ QQuery 18 │ 41.20 ms │                                   40.82 ms │ no change │
│ QQuery 19 │ 32.06 ms │                                   32.22 ms │ no change │
│ QQuery 20 │ 31.96 ms │                                   32.03 ms │ no change │
│ QQuery 21 │ 56.91 ms │                                   55.92 ms │ no change │
│ QQuery 22 │ 14.05 ms │                                   13.88 ms │ no change │
└───────────┴──────────┴────────────────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 715.47ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 710.86ms │
│ Average Time (HEAD)                                       │  32.52ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │  32.31ms │
│ Queries Faster                                            │        0 │
│ Queries Slower                                            │        0 │
│ Queries with No Change                                    │       22 │
│ Queries with Failure                                      │        0 │
└───────────────────────────────────────────────────────────┴──────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 41.04 / 42.30 ±1.18 / 43.83 ms │             40.59 / 42.22 ±1.72 / 44.67 ms │ no change │
│ QQuery 2  │ 18.62 / 19.19 ±0.60 / 20.33 ms │             18.57 / 18.82 ±0.29 / 19.38 ms │ no change │
│ QQuery 3  │ 28.82 / 28.99 ±0.14 / 29.18 ms │             28.46 / 28.90 ±0.43 / 29.72 ms │ no change │
│ QQuery 4  │ 17.61 / 18.16 ±0.61 / 19.28 ms │             17.60 / 17.76 ±0.11 / 17.89 ms │ no change │
│ QQuery 5  │ 36.16 / 36.39 ±0.27 / 36.91 ms │             35.92 / 35.96 ±0.04 / 36.02 ms │ no change │
│ QQuery 6  │ 13.96 / 14.06 ±0.09 / 14.22 ms │             13.91 / 14.26 ±0.57 / 15.40 ms │ no change │
│ QQuery 7  │ 40.89 / 42.00 ±0.84 / 43.23 ms │             40.81 / 44.05 ±2.01 / 45.89 ms │ no change │
│ QQuery 8  │ 40.64 / 41.50 ±0.72 / 42.37 ms │             40.53 / 40.75 ±0.30 / 41.33 ms │ no change │
│ QQuery 9  │ 49.62 / 50.84 ±1.23 / 53.07 ms │             49.22 / 50.27 ±0.91 / 51.82 ms │ no change │
│ QQuery 10 │ 40.88 / 41.36 ±0.86 / 43.08 ms │             40.42 / 41.00 ±0.39 / 41.58 ms │ no change │
│ QQuery 11 │ 13.85 / 13.95 ±0.12 / 14.19 ms │             13.66 / 13.82 ±0.09 / 13.95 ms │ no change │
│ QQuery 12 │ 17.84 / 18.45 ±0.54 / 19.35 ms │             17.93 / 18.45 ±0.27 / 18.63 ms │ no change │
│ QQuery 13 │ 40.39 / 41.68 ±1.23 / 43.53 ms │             39.88 / 40.38 ±0.40 / 41.08 ms │ no change │
│ QQuery 14 │ 24.53 / 24.67 ±0.14 / 24.89 ms │             24.23 / 24.61 ±0.45 / 25.47 ms │ no change │
│ QQuery 15 │ 31.45 / 32.30 ±0.84 / 33.45 ms │             31.07 / 31.88 ±1.01 / 33.84 ms │ no change │
│ QQuery 16 │ 13.63 / 13.74 ±0.08 / 13.88 ms │             13.56 / 13.66 ±0.10 / 13.83 ms │ no change │
│ QQuery 17 │ 69.37 / 70.15 ±0.83 / 71.77 ms │             69.61 / 70.73 ±0.83 / 72.03 ms │ no change │
│ QQuery 18 │ 41.20 / 41.83 ±0.72 / 43.06 ms │             40.82 / 41.37 ±0.34 / 41.85 ms │ no change │
│ QQuery 19 │ 32.06 / 33.13 ±1.85 / 36.81 ms │             32.22 / 33.43 ±1.33 / 35.45 ms │ no change │
│ QQuery 20 │ 31.96 / 32.36 ±0.22 / 32.59 ms │             32.03 / 32.60 ±0.53 / 33.54 ms │ no change │
│ QQuery 21 │ 56.91 / 58.04 ±1.17 / 60.19 ms │             55.92 / 58.33 ±2.56 / 62.98 ms │ no change │
│ QQuery 22 │ 14.05 / 14.12 ±0.06 / 14.22 ms │             13.88 / 13.98 ±0.06 / 14.04 ms │ no change │
└───────────┴────────────────────────────────┴────────────────────────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 729.22ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 727.21ms │
│ Average Time (HEAD)                                       │  33.15ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │  33.05ms │
│ 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 480.5 MiB
CPU user 19.6s
CPU sys 1.6s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.3 GiB
Avg memory 508.3 MiB
CPU user 19.4s
CPU sys 1.8s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

Comparing short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark tpcds
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 short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 1  │    5.94 ms │                                    5.91 ms │    no change │
│ QQuery 2  │   79.97 ms │                                   80.85 ms │    no change │
│ QQuery 3  │   29.11 ms │                                   29.50 ms │    no change │
│ QQuery 4  │  469.17 ms │                                  487.00 ms │    no change │
│ QQuery 5  │   51.63 ms │                                   50.83 ms │    no change │
│ QQuery 6  │   36.23 ms │                                   36.14 ms │    no change │
│ QQuery 7  │   73.12 ms │                                   73.26 ms │    no change │
│ QQuery 8  │   39.19 ms │                                   38.09 ms │    no change │
│ QQuery 9  │   55.09 ms │                                   53.19 ms │    no change │
│ QQuery 10 │   61.40 ms │                                   61.43 ms │    no change │
│ QQuery 11 │  304.08 ms │                                  301.17 ms │    no change │
│ QQuery 12 │   29.38 ms │                                   30.43 ms │    no change │
│ QQuery 13 │  114.81 ms │                                  115.74 ms │    no change │
│ QQuery 14 │  386.29 ms │                                  388.79 ms │    no change │
│ QQuery 15 │   54.48 ms │                                   59.69 ms │ 1.10x slower │
│ QQuery 16 │    6.03 ms │                                    6.59 ms │ 1.09x slower │
│ QQuery 17 │   77.37 ms │                                   77.28 ms │    no change │
│ QQuery 18 │   97.96 ms │                                   98.10 ms │    no change │
│ QQuery 19 │   41.82 ms │                                   42.01 ms │    no change │
│ QQuery 20 │   36.46 ms │                                   36.40 ms │    no change │
│ QQuery 21 │   17.31 ms │                                   17.49 ms │    no change │
│ QQuery 22 │   66.90 ms │                                   68.30 ms │    no change │
│ QQuery 23 │  312.96 ms │                                  305.51 ms │    no change │
│ QQuery 24 │  204.80 ms │                                  203.20 ms │    no change │
│ QQuery 25 │  105.64 ms │                                  104.52 ms │    no change │
│ QQuery 26 │   47.34 ms │                                   47.03 ms │    no change │
│ QQuery 27 │    5.39 ms │                                    5.41 ms │    no change │
│ QQuery 28 │   57.45 ms │                                   61.61 ms │ 1.07x slower │
│ QQuery 29 │   91.92 ms │                                   92.26 ms │    no change │
│ QQuery 30 │   33.14 ms │                                   33.29 ms │    no change │
│ QQuery 31 │  108.73 ms │                                  111.89 ms │    no change │
│ QQuery 32 │   20.81 ms │                                   21.39 ms │    no change │
│ QQuery 33 │   37.61 ms │                                   38.04 ms │    no change │
│ QQuery 34 │    5.77 ms │                                    6.13 ms │ 1.06x slower │
│ QQuery 35 │   73.95 ms │                                   75.05 ms │    no change │
│ QQuery 36 │    6.15 ms │                                    6.05 ms │    no change │
│ QQuery 37 │    7.39 ms │                                    7.46 ms │    no change │
│ QQuery 38 │   63.38 ms │                                   64.63 ms │    no change │
│ QQuery 39 │   76.21 ms │                                   76.46 ms │    no change │
│ QQuery 40 │   24.21 ms │                                   24.01 ms │    no change │
│ QQuery 41 │   13.54 ms │                                   13.61 ms │    no change │
│ QQuery 42 │   24.20 ms │                                   24.68 ms │    no change │
│ QQuery 43 │    4.63 ms │                                    4.92 ms │ 1.06x slower │
│ QQuery 44 │    5.81 ms │                                    5.91 ms │    no change │
│ QQuery 45 │   39.49 ms │                                   42.90 ms │ 1.09x slower │
│ QQuery 46 │   12.20 ms │                                   12.58 ms │    no change │
│ QQuery 47 │  234.69 ms │                                  238.45 ms │    no change │
│ QQuery 48 │   92.02 ms │                                   94.12 ms │    no change │
│ QQuery 49 │   71.80 ms │                                   71.57 ms │    no change │
│ QQuery 50 │   57.90 ms │                                   58.13 ms │    no change │
│ QQuery 51 │   96.64 ms │                                   95.83 ms │    no change │
│ QQuery 52 │   24.92 ms │                                   24.63 ms │    no change │
│ QQuery 53 │   29.74 ms │                                   29.98 ms │    no change │
│ QQuery 54 │   54.45 ms │                                   55.73 ms │    no change │
│ QQuery 55 │   24.38 ms │                                   24.79 ms │    no change │
│ QQuery 56 │   39.08 ms │                                   39.38 ms │    no change │
│ QQuery 57 │  171.83 ms │                                  173.08 ms │    no change │
│ QQuery 58 │  109.83 ms │                                  108.56 ms │    no change │
│ QQuery 59 │  115.57 ms │                                  116.01 ms │    no change │
│ QQuery 60 │   38.54 ms │                                   39.42 ms │    no change │
│ QQuery 61 │    9.31 ms │                                    9.65 ms │    no change │
│ QQuery 62 │   43.67 ms │                                   44.33 ms │    no change │
│ QQuery 63 │   30.14 ms │                                   29.93 ms │    no change │
│ QQuery 64 │  355.54 ms │                                  356.99 ms │    no change │
│ QQuery 65 │   71.68 ms │                                   71.30 ms │    no change │
│ QQuery 66 │   77.32 ms │                                   78.24 ms │    no change │
│ QQuery 67 │  237.49 ms │                                  242.88 ms │    no change │
│ QQuery 68 │    6.74 ms │                                    7.00 ms │    no change │
│ QQuery 69 │   56.68 ms │                                   58.24 ms │    no change │
│ QQuery 70 │   78.86 ms │                                   80.23 ms │    no change │
│ QQuery 71 │   35.60 ms │                                   36.24 ms │    no change │
│ QQuery 72 │ 1698.08 ms │                                 1759.83 ms │    no change │
│ QQuery 73 │    5.46 ms │                                    5.62 ms │    no change │
│ QQuery 74 │  215.11 ms │                                  217.82 ms │    no change │
│ QQuery 75 │  139.61 ms │                                  142.68 ms │    no change │
│ QQuery 76 │   34.18 ms │                                   35.46 ms │    no change │
│ QQuery 77 │   60.56 ms │                                   62.59 ms │    no change │
│ QQuery 78 │  279.85 ms │                                  285.07 ms │    no change │
│ QQuery 79 │   70.34 ms │                                   69.23 ms │    no change │
│ QQuery 80 │   96.14 ms │                                   96.50 ms │    no change │
│ QQuery 81 │   26.59 ms │                                   26.88 ms │    no change │
│ QQuery 82 │   17.10 ms │                                   17.05 ms │    no change │
│ QQuery 83 │   34.19 ms │                                   33.90 ms │    no change │
│ QQuery 84 │   30.50 ms │                                   30.12 ms │    no change │
│ QQuery 85 │   98.92 ms │                                   98.81 ms │    no change │
│ QQuery 86 │   26.28 ms │                                   25.82 ms │    no change │
│ QQuery 87 │   64.98 ms │                                   65.09 ms │    no change │
│ QQuery 88 │   61.27 ms │                                   61.66 ms │    no change │
│ QQuery 89 │   35.56 ms │                                   36.04 ms │    no change │
│ QQuery 90 │   16.85 ms │                                   16.95 ms │    no change │
│ QQuery 91 │   41.44 ms │                                   41.87 ms │    no change │
│ QQuery 92 │   29.89 ms │                                   30.18 ms │    no change │
│ QQuery 93 │   50.92 ms │                                   50.21 ms │    no change │
│ QQuery 94 │   39.49 ms │                                   39.00 ms │    no change │
│ QQuery 95 │   80.52 ms │                                   79.80 ms │    no change │
│ QQuery 96 │   24.11 ms │                                   24.11 ms │    no change │
│ QQuery 97 │   51.67 ms │                                   51.61 ms │    no change │
│ QQuery 98 │   44.62 ms │                                   44.44 ms │    no change │
│ QQuery 99 │   64.98 ms │                                   65.64 ms │    no change │
└───────────┴────────────┴────────────────────────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 9120.08ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 9245.39ms │
│ Average Time (HEAD)                                       │   92.12ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │   93.39ms │
│ Queries Faster                                            │         0 │
│ Queries Slower                                            │         6 │
│ Queries with No Change                                    │        93 │
│ Queries with Failure                                      │         0 │
└───────────────────────────────────────────────────────────┴───────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.94 / 6.51 ±0.88 / 8.27 ms │                5.91 / 6.49 ±0.96 / 8.40 ms │     no change │
│ QQuery 2  │        79.97 / 80.13 ±0.18 / 80.41 ms │             80.85 / 81.07 ±0.17 / 81.26 ms │     no change │
│ QQuery 3  │        29.11 / 29.40 ±0.22 / 29.70 ms │             29.50 / 29.71 ±0.23 / 30.15 ms │     no change │
│ QQuery 4  │    469.17 / 485.50 ±15.11 / 512.64 ms │          487.00 / 496.66 ±6.36 / 503.41 ms │     no change │
│ QQuery 5  │        51.63 / 54.30 ±1.89 / 56.58 ms │             50.83 / 51.45 ±0.47 / 52.01 ms │ +1.06x faster │
│ QQuery 6  │        36.23 / 36.97 ±0.55 / 37.49 ms │             36.14 / 36.48 ±0.20 / 36.66 ms │     no change │
│ QQuery 7  │        73.12 / 73.85 ±0.60 / 74.67 ms │             73.26 / 74.05 ±0.69 / 75.31 ms │     no change │
│ QQuery 8  │        39.19 / 40.52 ±2.18 / 44.86 ms │             38.09 / 39.34 ±1.32 / 41.88 ms │     no change │
│ QQuery 9  │        55.09 / 56.58 ±1.12 / 58.30 ms │             53.19 / 55.20 ±2.11 / 58.19 ms │     no change │
│ QQuery 10 │        61.40 / 61.82 ±0.32 / 62.30 ms │             61.43 / 62.25 ±0.72 / 63.29 ms │     no change │
│ QQuery 11 │     304.08 / 309.77 ±5.82 / 317.02 ms │          301.17 / 308.96 ±6.46 / 320.79 ms │     no change │
│ QQuery 12 │        29.38 / 29.83 ±0.24 / 30.07 ms │             30.43 / 30.72 ±0.19 / 31.01 ms │     no change │
│ QQuery 13 │     114.81 / 114.99 ±0.14 / 115.22 ms │          115.74 / 117.24 ±1.48 / 120.02 ms │     no change │
│ QQuery 14 │     386.29 / 386.92 ±0.71 / 388.21 ms │          388.79 / 390.43 ±2.22 / 394.74 ms │     no change │
│ QQuery 15 │        54.48 / 56.03 ±1.87 / 59.69 ms │             59.69 / 61.50 ±1.62 / 63.82 ms │  1.10x slower │
│ QQuery 16 │           6.03 / 6.22 ±0.24 / 6.67 ms │                6.59 / 6.67 ±0.08 / 6.82 ms │  1.07x slower │
│ QQuery 17 │        77.37 / 77.79 ±0.44 / 78.54 ms │             77.28 / 78.62 ±1.44 / 81.27 ms │     no change │
│ QQuery 18 │      97.96 / 101.01 ±3.54 / 107.93 ms │            98.10 / 99.32 ±0.67 / 100.08 ms │     no change │
│ QQuery 19 │        41.82 / 42.40 ±0.51 / 43.15 ms │             42.01 / 42.28 ±0.15 / 42.41 ms │     no change │
│ QQuery 20 │        36.46 / 37.42 ±0.75 / 38.67 ms │             36.40 / 36.93 ±0.35 / 37.30 ms │     no change │
│ QQuery 21 │        17.31 / 17.95 ±0.79 / 19.49 ms │             17.49 / 18.44 ±0.95 / 19.69 ms │     no change │
│ QQuery 22 │        66.90 / 67.78 ±0.58 / 68.54 ms │             68.30 / 69.67 ±1.56 / 72.22 ms │     no change │
│ QQuery 23 │     312.96 / 317.10 ±2.81 / 320.85 ms │          305.51 / 313.09 ±6.48 / 323.49 ms │     no change │
│ QQuery 24 │     204.80 / 208.96 ±4.10 / 216.48 ms │          203.20 / 205.30 ±1.86 / 207.58 ms │     no change │
│ QQuery 25 │     105.64 / 107.04 ±0.87 / 108.13 ms │          104.52 / 109.27 ±5.94 / 120.53 ms │     no change │
│ QQuery 26 │        47.34 / 47.84 ±0.60 / 49.01 ms │             47.03 / 47.67 ±0.33 / 47.96 ms │     no change │
│ QQuery 27 │           5.39 / 5.50 ±0.08 / 5.61 ms │                5.41 / 5.56 ±0.10 / 5.71 ms │     no change │
│ QQuery 28 │        57.45 / 60.43 ±1.97 / 62.20 ms │             61.61 / 63.83 ±2.81 / 69.37 ms │  1.06x slower │
│ QQuery 29 │        91.92 / 93.24 ±1.20 / 95.43 ms │             92.26 / 94.81 ±1.75 / 97.72 ms │     no change │
│ QQuery 30 │        33.14 / 34.38 ±1.44 / 37.12 ms │             33.29 / 33.91 ±0.55 / 34.85 ms │     no change │
│ QQuery 31 │     108.73 / 111.54 ±3.21 / 117.49 ms │          111.89 / 112.85 ±0.83 / 113.87 ms │     no change │
│ QQuery 32 │        20.81 / 21.21 ±0.25 / 21.48 ms │             21.39 / 21.54 ±0.12 / 21.69 ms │     no change │
│ QQuery 33 │        37.61 / 38.50 ±0.65 / 39.31 ms │             38.04 / 39.13 ±1.66 / 42.43 ms │     no change │
│ QQuery 34 │           5.77 / 5.88 ±0.08 / 6.03 ms │                6.13 / 6.20 ±0.06 / 6.29 ms │  1.05x slower │
│ QQuery 35 │        73.95 / 74.40 ±0.46 / 75.23 ms │             75.05 / 77.48 ±1.59 / 79.98 ms │     no change │
│ QQuery 36 │           6.15 / 6.29 ±0.16 / 6.60 ms │                6.05 / 6.13 ±0.09 / 6.31 ms │     no change │
│ QQuery 37 │           7.39 / 7.49 ±0.06 / 7.57 ms │                7.46 / 7.59 ±0.17 / 7.89 ms │     no change │
│ QQuery 38 │        63.38 / 65.08 ±1.55 / 67.89 ms │             64.63 / 65.21 ±0.43 / 65.67 ms │     no change │
│ QQuery 39 │        76.21 / 77.07 ±0.49 / 77.62 ms │             76.46 / 77.64 ±1.83 / 81.25 ms │     no change │
│ QQuery 40 │        24.21 / 24.50 ±0.27 / 24.97 ms │             24.01 / 24.29 ±0.30 / 24.81 ms │     no change │
│ QQuery 41 │        13.54 / 13.65 ±0.08 / 13.75 ms │             13.61 / 13.67 ±0.09 / 13.84 ms │     no change │
│ QQuery 42 │        24.20 / 24.48 ±0.22 / 24.74 ms │             24.68 / 26.32 ±1.67 / 29.52 ms │  1.08x slower │
│ QQuery 43 │           4.63 / 4.79 ±0.13 / 5.02 ms │                4.92 / 5.04 ±0.10 / 5.20 ms │  1.05x slower │
│ QQuery 44 │           5.81 / 5.87 ±0.04 / 5.92 ms │                5.91 / 6.02 ±0.11 / 6.22 ms │     no change │
│ QQuery 45 │        39.49 / 41.21 ±2.79 / 46.77 ms │             42.90 / 43.54 ±0.68 / 44.78 ms │  1.06x slower │
│ QQuery 46 │        12.20 / 12.96 ±0.61 / 13.86 ms │             12.58 / 13.38 ±1.53 / 16.44 ms │     no change │
│ QQuery 47 │     234.69 / 245.25 ±9.88 / 262.18 ms │          238.45 / 250.02 ±7.65 / 262.11 ms │     no change │
│ QQuery 48 │        92.02 / 93.28 ±0.70 / 93.93 ms │            94.12 / 96.23 ±2.45 / 100.95 ms │     no change │
│ QQuery 49 │        71.80 / 72.80 ±0.86 / 74.11 ms │             71.57 / 72.88 ±0.91 / 74.31 ms │     no change │
│ QQuery 50 │        57.90 / 58.99 ±1.12 / 60.97 ms │             58.13 / 58.48 ±0.41 / 59.27 ms │     no change │
│ QQuery 51 │       96.64 / 99.70 ±2.76 / 104.75 ms │            95.83 / 97.86 ±1.74 / 100.42 ms │     no change │
│ QQuery 52 │        24.92 / 25.37 ±0.52 / 26.31 ms │             24.63 / 25.03 ±0.30 / 25.54 ms │     no change │
│ QQuery 53 │        29.74 / 30.21 ±0.41 / 30.87 ms │             29.98 / 31.16 ±1.53 / 34.04 ms │     no change │
│ QQuery 54 │        54.45 / 54.91 ±0.29 / 55.19 ms │             55.73 / 56.07 ±0.26 / 56.39 ms │     no change │
│ QQuery 55 │        24.38 / 24.54 ±0.19 / 24.86 ms │             24.79 / 26.31 ±2.80 / 31.90 ms │  1.07x slower │
│ QQuery 56 │        39.08 / 39.64 ±0.39 / 40.18 ms │             39.38 / 39.79 ±0.31 / 40.34 ms │     no change │
│ QQuery 57 │     171.83 / 176.17 ±3.54 / 182.40 ms │          173.08 / 174.19 ±0.94 / 175.83 ms │     no change │
│ QQuery 58 │     109.83 / 111.03 ±1.00 / 112.79 ms │          108.56 / 110.24 ±1.49 / 112.32 ms │     no change │
│ QQuery 59 │     115.57 / 116.57 ±0.66 / 117.59 ms │          116.01 / 118.20 ±1.98 / 121.92 ms │     no change │
│ QQuery 60 │        38.54 / 39.75 ±0.87 / 41.25 ms │             39.42 / 39.95 ±0.30 / 40.34 ms │     no change │
│ QQuery 61 │           9.31 / 9.50 ±0.13 / 9.68 ms │              9.65 / 10.68 ±2.00 / 14.68 ms │  1.12x slower │
│ QQuery 62 │        43.67 / 44.44 ±0.84 / 46.02 ms │             44.33 / 44.67 ±0.35 / 45.29 ms │     no change │
│ QQuery 63 │        30.14 / 30.35 ±0.19 / 30.65 ms │             29.93 / 30.26 ±0.33 / 30.84 ms │     no change │
│ QQuery 64 │     355.54 / 365.08 ±6.03 / 374.34 ms │          356.99 / 362.93 ±3.69 / 366.98 ms │     no change │
│ QQuery 65 │        71.68 / 72.85 ±1.08 / 74.89 ms │             71.30 / 72.37 ±0.88 / 73.53 ms │     no change │
│ QQuery 66 │        77.32 / 79.61 ±2.90 / 85.01 ms │             78.24 / 80.10 ±3.40 / 86.90 ms │     no change │
│ QQuery 67 │     237.49 / 242.20 ±4.02 / 249.16 ms │          242.88 / 249.98 ±5.85 / 257.16 ms │     no change │
│ QQuery 68 │           6.74 / 7.05 ±0.19 / 7.32 ms │                7.00 / 7.15 ±0.08 / 7.23 ms │     no change │
│ QQuery 69 │        56.68 / 57.44 ±0.80 / 58.59 ms │             58.24 / 58.67 ±0.34 / 59.07 ms │     no change │
│ QQuery 70 │        78.86 / 81.57 ±3.93 / 89.39 ms │             80.23 / 80.72 ±0.36 / 81.30 ms │     no change │
│ QQuery 71 │        35.60 / 36.10 ±0.33 / 36.57 ms │             36.24 / 37.80 ±1.37 / 39.72 ms │     no change │
│ QQuery 72 │ 1698.08 / 1778.24 ±72.27 / 1877.20 ms │      1759.83 / 1790.58 ±24.35 / 1825.42 ms │     no change │
│ QQuery 73 │           5.46 / 5.63 ±0.10 / 5.78 ms │                5.62 / 5.74 ±0.10 / 5.92 ms │     no change │
│ QQuery 74 │     215.11 / 220.86 ±4.07 / 225.43 ms │          217.82 / 222.51 ±3.03 / 226.69 ms │     no change │
│ QQuery 75 │     139.61 / 141.06 ±1.27 / 142.92 ms │          142.68 / 145.35 ±2.45 / 149.29 ms │     no change │
│ QQuery 76 │        34.18 / 36.56 ±2.69 / 41.71 ms │             35.46 / 36.84 ±1.60 / 39.93 ms │     no change │
│ QQuery 77 │        60.56 / 61.17 ±0.44 / 61.73 ms │             62.59 / 63.11 ±0.54 / 63.94 ms │     no change │
│ QQuery 78 │    279.85 / 293.75 ±12.08 / 309.90 ms │         285.07 / 299.15 ±14.74 / 319.20 ms │     no change │
│ QQuery 79 │        70.34 / 74.70 ±4.46 / 81.16 ms │             69.23 / 70.87 ±1.25 / 72.85 ms │ +1.05x faster │
│ QQuery 80 │       96.14 / 98.83 ±1.66 / 100.87 ms │             96.50 / 98.03 ±1.46 / 99.98 ms │     no change │
│ QQuery 81 │        26.59 / 26.96 ±0.32 / 27.55 ms │             26.88 / 27.01 ±0.16 / 27.32 ms │     no change │
│ QQuery 82 │        17.10 / 17.22 ±0.09 / 17.34 ms │             17.05 / 17.23 ±0.15 / 17.49 ms │     no change │
│ QQuery 83 │        34.19 / 35.97 ±2.95 / 41.86 ms │             33.90 / 35.48 ±2.32 / 40.09 ms │     no change │
│ QQuery 84 │        30.50 / 31.61 ±1.04 / 33.57 ms │             30.12 / 30.33 ±0.16 / 30.58 ms │     no change │
│ QQuery 85 │      98.92 / 100.42 ±1.25 / 101.90 ms │           98.81 / 102.72 ±6.43 / 115.54 ms │     no change │
│ QQuery 86 │        26.28 / 26.57 ±0.15 / 26.71 ms │             25.82 / 26.17 ±0.28 / 26.59 ms │     no change │
│ QQuery 87 │        64.98 / 66.88 ±2.57 / 71.86 ms │             65.09 / 67.92 ±1.57 / 69.85 ms │     no change │
│ QQuery 88 │        61.27 / 62.55 ±1.84 / 66.19 ms │             61.66 / 62.06 ±0.29 / 62.41 ms │     no change │
│ QQuery 89 │        35.56 / 36.28 ±0.61 / 37.02 ms │             36.04 / 37.55 ±2.67 / 42.88 ms │     no change │
│ QQuery 90 │        16.85 / 17.06 ±0.17 / 17.36 ms │             16.95 / 17.11 ±0.16 / 17.35 ms │     no change │
│ QQuery 91 │        41.44 / 42.59 ±1.86 / 46.30 ms │             41.87 / 42.81 ±1.22 / 45.18 ms │     no change │
│ QQuery 92 │        29.89 / 30.60 ±0.59 / 31.62 ms │             30.18 / 30.92 ±0.53 / 31.67 ms │     no change │
│ QQuery 93 │        50.92 / 52.11 ±0.87 / 53.13 ms │             50.21 / 51.14 ±1.04 / 53.03 ms │     no change │
│ QQuery 94 │        39.49 / 40.67 ±0.65 / 41.47 ms │             39.00 / 40.77 ±2.18 / 45.01 ms │     no change │
│ QQuery 95 │        80.52 / 81.71 ±1.91 / 85.48 ms │             79.80 / 81.12 ±1.15 / 82.59 ms │     no change │
│ QQuery 96 │        24.11 / 24.21 ±0.14 / 24.48 ms │             24.11 / 24.25 ±0.07 / 24.30 ms │     no change │
│ QQuery 97 │        51.67 / 52.59 ±1.00 / 54.42 ms │             51.61 / 53.30 ±1.60 / 56.11 ms │     no change │
│ QQuery 98 │        44.62 / 44.98 ±0.31 / 45.41 ms │             44.44 / 46.16 ±1.71 / 49.00 ms │     no change │
│ QQuery 99 │        64.98 / 65.60 ±0.36 / 66.08 ms │             65.64 / 66.19 ±0.57 / 67.22 ms │     no change │
└───────────┴───────────────────────────────────────┴────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 9364.87ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 9437.11ms │
│ Average Time (HEAD)                                       │   94.59ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │   95.32ms │
│ Queries Faster                                            │         2 │
│ Queries Slower                                            │         9 │
│ Queries with No Change                                    │        88 │
│ Queries with Failure                                      │         0 │
└───────────────────────────────────────────────────────────┴───────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 50.0s
Peak memory 2.2 GiB
Avg memory 1.5 GiB
CPU user 199.6s
CPU sys 5.7s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 50.0s
Peak memory 2.1 GiB
Avg memory 1.5 GiB
CPU user 200.0s
CPU sys 5.9s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

Comparing short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark clickbench_partitioned
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 short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │    1.16 ms │                                    1.29 ms │  1.12x slower │
│ QQuery 1  │   11.94 ms │                                   12.32 ms │     no change │
│ QQuery 2  │   34.92 ms │                                   35.22 ms │     no change │
│ QQuery 3  │   30.66 ms │                                   32.08 ms │     no change │
│ QQuery 4  │  249.84 ms │                                  251.50 ms │     no change │
│ QQuery 5  │  301.65 ms │                                  286.60 ms │     no change │
│ QQuery 6  │    1.33 ms │                                    1.26 ms │ +1.05x faster │
│ QQuery 7  │   14.28 ms │                                   13.97 ms │     no change │
│ QQuery 8  │  367.73 ms │                                  359.21 ms │     no change │
│ QQuery 9  │  509.94 ms │                                  526.63 ms │     no change │
│ QQuery 10 │   69.03 ms │                                   69.20 ms │     no change │
│ QQuery 11 │   79.37 ms │                                   80.74 ms │     no change │
│ QQuery 12 │  293.61 ms │                                  293.58 ms │     no change │
│ QQuery 13 │  402.43 ms │                                  389.66 ms │     no change │
│ QQuery 14 │  309.90 ms │                                  283.97 ms │ +1.09x faster │
│ QQuery 15 │  317.92 ms │                                  310.97 ms │     no change │
│ QQuery 16 │  649.04 ms │                                  650.36 ms │     no change │
│ QQuery 17 │  671.41 ms │                                  669.13 ms │     no change │
│ QQuery 18 │ 1308.53 ms │                                 1316.07 ms │     no change │
│ QQuery 19 │   29.13 ms │                                   29.34 ms │     no change │
│ QQuery 20 │  533.33 ms │                                  529.85 ms │     no change │
│ QQuery 21 │  528.35 ms │                                  524.45 ms │     no change │
│ QQuery 22 │ 1025.37 ms │                                 1030.67 ms │     no change │
│ QQuery 23 │ 3236.23 ms │                                 3244.73 ms │     no change │
│ QQuery 24 │   42.14 ms │                                   42.24 ms │     no change │
│ QQuery 25 │  108.97 ms │                                  109.20 ms │     no change │
│ QQuery 26 │   42.57 ms │                                   42.69 ms │     no change │
│ QQuery 27 │  528.03 ms │                                  526.68 ms │     no change │
│ QQuery 28 │ 2948.12 ms │                                 2956.26 ms │     no change │
│ QQuery 29 │   38.94 ms │                                   38.71 ms │     no change │
│ QQuery 30 │  317.78 ms │                                  319.58 ms │     no change │
│ QQuery 31 │  294.09 ms │                                  286.07 ms │     no change │
│ QQuery 32 │ 1046.16 ms │                                  966.83 ms │ +1.08x faster │
│ QQuery 33 │ 1620.25 ms │                                 1516.91 ms │ +1.07x faster │
│ QQuery 34 │ 1648.08 ms │                                 1569.38 ms │     no change │
│ QQuery 35 │  347.21 ms │                                  307.19 ms │ +1.13x faster │
│ QQuery 36 │   73.79 ms │                                   72.37 ms │     no change │
│ QQuery 37 │   36.07 ms │                                   35.23 ms │     no change │
│ QQuery 38 │   40.46 ms │                                   39.57 ms │     no change │
│ QQuery 39 │  157.26 ms │                                  144.02 ms │ +1.09x faster │
│ QQuery 40 │   14.04 ms │                                   14.26 ms │     no change │
│ QQuery 41 │   13.61 ms │                                   13.26 ms │     no change │
│ QQuery 42 │   13.18 ms │                                   12.75 ms │     no change │
└───────────┴────────────┴────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 20307.81ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 19955.97ms │
│ Average Time (HEAD)                                       │   472.27ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │   464.09ms │
│ Queries Faster                                            │          6 │
│ Queries Slower                                            │          1 │
│ Queries with No Change                                    │         36 │
│ Queries with Failure                                      │          0 │
└───────────────────────────────────────────────────────────┴────────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │           1.16 / 1.78 ±1.11 / 3.99 ms │                1.29 / 1.95 ±1.17 / 4.28 ms │  1.10x slower │
│ QQuery 1  │        11.94 / 12.34 ±0.24 / 12.68 ms │             12.32 / 12.56 ±0.13 / 12.67 ms │     no change │
│ QQuery 2  │        34.92 / 35.21 ±0.23 / 35.57 ms │             35.22 / 35.50 ±0.24 / 35.91 ms │     no change │
│ QQuery 3  │        30.66 / 31.47 ±0.84 / 33.00 ms │             32.08 / 32.26 ±0.16 / 32.49 ms │     no change │
│ QQuery 4  │     249.84 / 262.07 ±7.39 / 271.09 ms │          251.50 / 258.40 ±4.80 / 264.41 ms │     no change │
│ QQuery 5  │     301.65 / 307.18 ±4.66 / 312.46 ms │          286.60 / 294.06 ±3.86 / 297.77 ms │     no change │
│ QQuery 6  │           1.33 / 1.70 ±0.53 / 2.75 ms │                1.26 / 1.43 ±0.25 / 1.92 ms │ +1.19x faster │
│ QQuery 7  │        14.28 / 14.46 ±0.10 / 14.60 ms │             13.97 / 14.17 ±0.15 / 14.30 ms │     no change │
│ QQuery 8  │     367.73 / 375.09 ±5.42 / 381.88 ms │          359.21 / 365.94 ±7.12 / 379.38 ms │     no change │
│ QQuery 9  │    509.94 / 528.05 ±15.54 / 555.22 ms │         526.63 / 542.08 ±11.97 / 561.32 ms │     no change │
│ QQuery 10 │        69.03 / 70.14 ±1.27 / 72.60 ms │             69.20 / 70.22 ±0.67 / 70.97 ms │     no change │
│ QQuery 11 │        79.37 / 80.51 ±0.98 / 81.85 ms │             80.74 / 83.27 ±1.92 / 86.33 ms │     no change │
│ QQuery 12 │     293.61 / 301.98 ±5.85 / 310.68 ms │          293.58 / 302.00 ±6.28 / 310.63 ms │     no change │
│ QQuery 13 │    402.43 / 416.68 ±17.58 / 450.98 ms │         389.66 / 402.30 ±11.03 / 417.76 ms │     no change │
│ QQuery 14 │     309.90 / 317.90 ±5.26 / 323.61 ms │         283.97 / 302.14 ±13.98 / 325.35 ms │     no change │
│ QQuery 15 │     317.92 / 324.73 ±3.79 / 329.59 ms │         310.97 / 321.20 ±11.40 / 342.61 ms │     no change │
│ QQuery 16 │     649.04 / 666.98 ±9.36 / 674.72 ms │         650.36 / 672.50 ±24.21 / 705.99 ms │     no change │
│ QQuery 17 │    671.41 / 692.73 ±23.59 / 732.82 ms │         669.13 / 691.58 ±21.08 / 720.67 ms │     no change │
│ QQuery 18 │ 1308.53 / 1340.54 ±42.43 / 1421.84 ms │      1316.07 / 1379.68 ±37.66 / 1431.12 ms │     no change │
│ QQuery 19 │        29.13 / 30.10 ±1.53 / 33.12 ms │           29.34 / 49.43 ±38.58 / 126.57 ms │  1.64x slower │
│ QQuery 20 │     533.33 / 540.53 ±8.09 / 555.41 ms │          529.85 / 540.83 ±7.33 / 550.72 ms │     no change │
│ QQuery 21 │     528.35 / 537.57 ±9.90 / 551.41 ms │          524.45 / 533.91 ±6.86 / 544.16 ms │     no change │
│ QQuery 22 │ 1025.37 / 1042.22 ±11.54 / 1059.16 ms │      1030.67 / 1042.42 ±10.87 / 1060.16 ms │     no change │
│ QQuery 23 │ 3236.23 / 3272.86 ±32.70 / 3334.44 ms │      3244.73 / 3264.48 ±12.12 / 3277.28 ms │     no change │
│ QQuery 24 │        42.14 / 43.08 ±1.40 / 45.82 ms │             42.24 / 46.61 ±6.33 / 58.74 ms │  1.08x slower │
│ QQuery 25 │     108.97 / 116.24 ±9.01 / 134.00 ms │          109.20 / 112.25 ±3.11 / 116.98 ms │     no change │
│ QQuery 26 │        42.57 / 46.73 ±6.88 / 60.46 ms │             42.69 / 43.37 ±0.67 / 44.28 ms │ +1.08x faster │
│ QQuery 27 │     528.03 / 534.53 ±8.73 / 551.67 ms │          526.68 / 534.47 ±5.52 / 540.79 ms │     no change │
│ QQuery 28 │ 2948.12 / 2970.05 ±12.55 / 2985.76 ms │      2956.26 / 2969.43 ±12.55 / 2990.21 ms │     no change │
│ QQuery 29 │        38.94 / 42.75 ±7.40 / 57.55 ms │             38.71 / 38.86 ±0.12 / 39.02 ms │ +1.10x faster │
│ QQuery 30 │    317.78 / 337.86 ±17.91 / 370.08 ms │          319.58 / 325.29 ±4.86 / 332.63 ms │     no change │
│ QQuery 31 │     294.09 / 299.58 ±4.34 / 307.07 ms │          286.07 / 291.58 ±4.42 / 296.91 ms │     no change │
│ QQuery 32 │ 1046.16 / 1098.25 ±40.79 / 1157.47 ms │        966.83 / 987.56 ±20.19 / 1025.66 ms │ +1.11x faster │
│ QQuery 33 │ 1620.25 / 1652.04 ±27.94 / 1697.69 ms │      1516.91 / 1571.52 ±31.51 / 1613.39 ms │     no change │
│ QQuery 34 │ 1648.08 / 1715.34 ±49.14 / 1780.66 ms │       1569.38 / 1576.98 ±7.75 / 1589.26 ms │ +1.09x faster │
│ QQuery 35 │    347.21 / 386.80 ±41.23 / 461.35 ms │         307.19 / 366.39 ±75.13 / 513.76 ms │ +1.06x faster │
│ QQuery 36 │        73.79 / 78.04 ±3.62 / 84.15 ms │           72.37 / 86.81 ±15.08 / 113.43 ms │  1.11x slower │
│ QQuery 37 │        36.07 / 37.25 ±1.77 / 40.69 ms │             35.23 / 37.75 ±2.23 / 41.45 ms │     no change │
│ QQuery 38 │        40.46 / 43.20 ±1.81 / 45.89 ms │             39.57 / 41.60 ±1.70 / 43.83 ms │     no change │
│ QQuery 39 │     157.26 / 171.87 ±9.66 / 182.35 ms │          144.02 / 153.51 ±7.68 / 163.58 ms │ +1.12x faster │
│ QQuery 40 │        14.04 / 16.34 ±3.72 / 23.75 ms │             14.26 / 15.61 ±1.78 / 19.13 ms │     no change │
│ QQuery 41 │        13.61 / 13.71 ±0.10 / 13.89 ms │             13.26 / 14.58 ±2.42 / 19.40 ms │  1.06x slower │
│ QQuery 42 │        13.18 / 14.22 ±1.83 / 17.88 ms │             12.75 / 12.92 ±0.17 / 13.25 ms │ +1.10x faster │
└───────────┴───────────────────────────────────────┴────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 20822.67ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 20441.35ms │
│ Average Time (HEAD)                                       │   484.25ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │   475.38ms │
│ Queries Faster                                            │          8 │
│ Queries Slower                                            │          5 │
│ Queries with No Change                                    │         30 │
│ Queries with Failure                                      │          0 │
└───────────────────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 105.0s
Peak memory 12.3 GiB
Avg memory 4.7 GiB
CPU user 1061.0s
CPU sys 79.7s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 105.0s
Peak memory 11.6 GiB
Avg memory 4.6 GiB
CPU user 1041.1s
CPU sys 77.8s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

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

Comparing short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark binary_op
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

group                                               HEAD                                   short-circut-and-or-not-case-when-coalesce
-----                                               ----                                   ------------------------------------------
conjunction/k16_p0.7_w0/left_deep                   1.00     32.3±0.04µs        ? ?/sec    1.02     32.9±0.05µs        ? ?/sec
conjunction/k16_p0.7_w0/right_deep                  1.00     32.2±0.05µs        ? ?/sec    1.02     32.9±0.05µs        ? ?/sec
conjunction/k16_p0.7_w32/left_deep                  1.00     32.3±0.07µs        ? ?/sec    1.02     32.9±0.04µs        ? ?/sec
conjunction/k16_p0.7_w32/right_deep                 1.00     32.2±0.03µs        ? ?/sec    1.02     32.8±0.04µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w0/left_deep        1.00    341.2±1.54µs        ? ?/sec    1.04    353.8±2.64µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w0/right_deep       1.00    347.5±1.92µs        ? ?/sec    1.02    355.4±2.16µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w32/left_deep       1.00    410.8±1.49µs        ? ?/sec    1.04    426.2±4.70µs        ? ?/sec
conjunction/k4_p0.5_nulls_regex_w32/right_deep      1.00    404.6±1.63µs        ? ?/sec    1.07    433.3±4.96µs        ? ?/sec
conjunction/k4_p0.5_w0/left_deep                    1.00      7.9±0.01µs        ? ?/sec    1.01      8.0±0.01µs        ? ?/sec
conjunction/k4_p0.5_w0/right_deep                   1.00      7.9±0.02µs        ? ?/sec    1.01      8.0±0.02µs        ? ?/sec
conjunction/k4_p0.5_w32/left_deep                   1.00      7.9±0.01µs        ? ?/sec    1.01      8.0±0.01µs        ? ?/sec
conjunction/k4_p0.5_w32/right_deep                  1.00      7.9±0.02µs        ? ?/sec    1.01      8.0±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w0/left_deep      1.00    323.1±1.25µs        ? ?/sec    1.02    328.6±1.94µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w0/right_deep     1.00    321.6±1.76µs        ? ?/sec    1.02    327.4±1.67µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w32/left_deep     1.00    366.2±1.46µs        ? ?/sec    1.03    378.7±2.63µs        ? ?/sec
conjunction/k8_p0.1_then0.9_regex_w32/right_deep    1.00    373.3±1.31µs        ? ?/sec    1.01    376.5±4.58µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w0/left_deep            1.00     16.1±0.03µs        ? ?/sec    1.01     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w0/right_deep           1.00     16.1±0.04µs        ? ?/sec    1.01     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w32/left_deep           1.00     16.1±0.05µs        ? ?/sec    1.01     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.1_then0.9_w32/right_deep          1.00     16.1±0.03µs        ? ?/sec    1.01     16.2±0.02µs        ? ?/sec
conjunction/k8_p0.7_cast_w0/left_deep               1.00     23.6±0.04µs        ? ?/sec    1.02     23.9±0.03µs        ? ?/sec
conjunction/k8_p0.7_cast_w0/right_deep              1.00     23.6±0.04µs        ? ?/sec    1.02     23.9±0.02µs        ? ?/sec
conjunction/k8_p0.7_cast_w32/left_deep              1.00     24.9±0.03µs        ? ?/sec    1.05     26.1±0.03µs        ? ?/sec
conjunction/k8_p0.7_cast_w32/right_deep             1.00     23.6±0.05µs        ? ?/sec    1.02     24.0±0.03µs        ? ?/sec
conjunction/k8_p0.7_inlist_w0/left_deep             1.00     37.5±0.02µs        ? ?/sec    1.01     37.8±0.03µs        ? ?/sec
conjunction/k8_p0.7_inlist_w0/right_deep            1.00     37.5±0.02µs        ? ?/sec    1.01     37.8±0.04µs        ? ?/sec
conjunction/k8_p0.7_inlist_w32/left_deep            1.00     37.5±0.03µs        ? ?/sec    1.01     37.8±0.03µs        ? ?/sec
conjunction/k8_p0.7_inlist_w32/right_deep           1.00     37.5±0.03µs        ? ?/sec    1.01     37.8±0.04µs        ? ?/sec
conjunction/k8_p0.7_plus_w0/left_deep               1.00     22.9±0.05µs        ? ?/sec    1.01     23.1±0.60µs        ? ?/sec
conjunction/k8_p0.7_plus_w0/right_deep              1.00     22.8±0.03µs        ? ?/sec    1.01     23.1±0.13µs        ? ?/sec
conjunction/k8_p0.7_plus_w32/left_deep              1.00     23.3±0.03µs        ? ?/sec    1.02     23.7±0.03µs        ? ?/sec
conjunction/k8_p0.7_plus_w32/right_deep             1.00     23.0±0.03µs        ? ?/sec    1.00     23.0±0.03µs        ? ?/sec
conjunction/k8_p0.7_regex_w0/left_deep              1.00    327.7±1.60µs        ? ?/sec    1.01    331.2±1.71µs        ? ?/sec
conjunction/k8_p0.7_regex_w0/right_deep             1.00    328.0±1.51µs        ? ?/sec    1.01    332.3±2.11µs        ? ?/sec
conjunction/k8_p0.7_regex_w32/left_deep             1.00    377.9±1.51µs        ? ?/sec    1.05    396.1±2.35µs        ? ?/sec
conjunction/k8_p0.7_regex_w32/right_deep            1.00    394.1±1.95µs        ? ?/sec    1.00    394.7±3.87µs        ? ?/sec
conjunction/k8_p0.7_w0/left_deep                    1.00     16.0±0.04µs        ? ?/sec    1.02     16.3±0.04µs        ? ?/sec
conjunction/k8_p0.7_w0/right_deep                   1.00     16.1±0.04µs        ? ?/sec    1.01     16.3±0.03µs        ? ?/sec
conjunction/k8_p0.7_w32/left_deep                   1.00     16.1±0.03µs        ? ?/sec    1.01     16.3±0.02µs        ? ?/sec
conjunction/k8_p0.7_w32/right_deep                  1.00     16.0±0.03µs        ? ?/sec    1.02     16.3±0.03µs        ? ?/sec
conjunction/k8_p0.9_w0/left_deep                    1.00     15.9±0.02µs        ? ?/sec    1.01     16.1±0.02µs        ? ?/sec
conjunction/k8_p0.9_w0/right_deep                   1.00     15.9±0.02µs        ? ?/sec    1.01     16.1±0.02µs        ? ?/sec
conjunction/k8_p0.9_w32/left_deep                   1.00     15.9±0.02µs        ? ?/sec    1.02     16.1±0.02µs        ? ?/sec
conjunction/k8_p0.9_w32/right_deep                  1.00     15.9±0.03µs        ? ?/sec    1.02     16.2±0.04µs        ? ?/sec
date32_subtract/20_percent_nulls                    1.00  1112.2±12.87ns        ? ?/sec    1.00   1111.0±6.70ns        ? ?/sec
date32_subtract/no_nulls                            1.00    976.6±5.68ns        ? ?/sec    1.00    975.7±7.81ns        ? ?/sec
date64_subtract/20_percent_nulls                    1.00      6.1±0.00µs        ? ?/sec    1.00      6.1±0.01µs        ? ?/sec
date64_subtract/no_nulls                            1.00      6.0±0.00µs        ? ?/sec    1.00      6.0±0.00µs        ? ?/sec
short_circuit/and/all_false                         1.00     64.5±1.05ns        ? ?/sec    1.22     78.6±5.91ns        ? ?/sec
short_circuit/and/all_true_in_and                   1.00    694.0±2.55µs        ? ?/sec    1.01    700.5±5.04µs        ? ?/sec
short_circuit/and/one_true_first                    1.01    301.3±1.35µs        ? ?/sec    1.00    299.0±0.79µs        ? ?/sec
short_circuit/and/one_true_last                     1.00    270.8±1.19µs        ? ?/sec    1.00    271.0±1.36µs        ? ?/sec
short_circuit/and/one_true_middle                   1.00    268.5±1.09µs        ? ?/sec    1.01    270.3±0.86µs        ? ?/sec
short_circuit/and/one_true_middle_left              1.01    267.5±1.08µs        ? ?/sec    1.00    265.2±0.75µs        ? ?/sec
short_circuit/and/one_true_middle_right             1.00    271.8±1.15µs        ? ?/sec    1.00    270.6±0.94µs        ? ?/sec
short_circuit/or/all_false_in_or                    1.08   750.3±84.10µs        ? ?/sec    1.00    693.6±2.97µs        ? ?/sec
short_circuit/or/all_true                           1.00     73.3±0.63ns        ? ?/sec    1.01     74.0±0.63ns        ? ?/sec
short_circuit/or/one_false_first                    1.01    271.0±0.79µs        ? ?/sec    1.00    268.3±0.71µs        ? ?/sec
short_circuit/or/one_false_last                     1.01    297.2±1.57µs        ? ?/sec    1.00    294.5±0.61µs        ? ?/sec
short_circuit/or/one_false_middle                   1.01    296.8±1.16µs        ? ?/sec    1.00    294.8±0.65µs        ? ?/sec
short_circuit/or/one_false_middle_left              1.01    292.4±1.30µs        ? ?/sec    1.00    290.1±0.66µs        ? ?/sec
short_circuit/or/one_false_middle_right             1.01    297.2±1.01µs        ? ?/sec    1.00    294.6±0.79µs        ? ?/sec

Resource Usage

binary_op — base (merge-base)

Metric Value
Wall time 865.2s
Peak memory 84.4 MiB
Avg memory 58.1 MiB
CPU user 781.0s
CPU sys 0.8s
Peak spill 0 B

binary_op — branch

Metric Value
Wall time 865.2s
Peak memory 86.3 MiB
Avg memory 57.6 MiB
CPU user 772.8s
CPU sys 0.7s
Peak spill 0 B

File an issue against this benchmark runner

@rluvaton

Copy link
Copy Markdown
Member Author

run benchmark clickbench_partitioned

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c7098142222-5628-s659j 6.12.105+ #1 SMP Sat Sep 19 07:55:25 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 short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark 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)

Comparing short-circut-and-or-not-case-when-coalesce (1133558) to 665eca4 (merge-base) diff

Run configuration
run benchmark clickbench_partitioned
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 short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0  │    1.19 ms │                                    1.16 ms │    no change │
│ QQuery 1  │   12.23 ms │                                   11.79 ms │    no change │
│ QQuery 2  │   35.19 ms │                                   34.73 ms │    no change │
│ QQuery 3  │   31.66 ms │                                   31.09 ms │    no change │
│ QQuery 4  │  241.49 ms │                                  235.60 ms │    no change │
│ QQuery 5  │  279.69 ms │                                  280.52 ms │    no change │
│ QQuery 6  │    1.20 ms │                                    1.21 ms │    no change │
│ QQuery 7  │   13.29 ms │                                   13.09 ms │    no change │
│ QQuery 8  │  332.66 ms │                                  326.99 ms │    no change │
│ QQuery 9  │  474.73 ms │                                  467.05 ms │    no change │
│ QQuery 10 │   66.38 ms │                                   66.26 ms │    no change │
│ QQuery 11 │   75.89 ms │                                   76.26 ms │    no change │
│ QQuery 12 │  266.81 ms │                                  266.13 ms │    no change │
│ QQuery 13 │  360.22 ms │                                  359.60 ms │    no change │
│ QQuery 14 │  280.72 ms │                                  280.80 ms │    no change │
│ QQuery 15 │  289.75 ms │                                  282.70 ms │    no change │
│ QQuery 16 │  620.22 ms │                                  618.95 ms │    no change │
│ QQuery 17 │  622.63 ms │                                  616.94 ms │    no change │
│ QQuery 18 │ 1218.56 ms │                                 1215.20 ms │    no change │
│ QQuery 19 │   27.56 ms │                                   27.58 ms │    no change │
│ QQuery 20 │  520.41 ms │                                  516.87 ms │    no change │
│ QQuery 21 │  513.01 ms │                                  514.57 ms │    no change │
│ QQuery 22 │  976.60 ms │                                  986.10 ms │    no change │
│ QQuery 23 │ 3061.49 ms │                                 3127.18 ms │    no change │
│ QQuery 24 │   40.73 ms │                                   40.88 ms │    no change │
│ QQuery 25 │  105.32 ms │                                  105.53 ms │    no change │
│ QQuery 26 │   41.44 ms │                                   41.52 ms │    no change │
│ QQuery 27 │  511.90 ms │                                  517.37 ms │    no change │
│ QQuery 28 │ 2856.72 ms │                                 2877.99 ms │    no change │
│ QQuery 29 │   38.40 ms │                                   38.15 ms │    no change │
│ QQuery 30 │  308.64 ms │                                  307.37 ms │    no change │
│ QQuery 31 │  278.37 ms │                                  284.42 ms │    no change │
│ QQuery 32 │  960.97 ms │                                  933.42 ms │    no change │
│ QQuery 33 │ 1442.20 ms │                                 1468.27 ms │    no change │
│ QQuery 34 │ 1457.64 ms │                                 1457.91 ms │    no change │
│ QQuery 35 │  288.16 ms │                                  293.51 ms │    no change │
│ QQuery 36 │   64.85 ms │                                   68.58 ms │ 1.06x slower │
│ QQuery 37 │   34.31 ms │                                   34.60 ms │    no change │
│ QQuery 38 │   39.51 ms │                                   38.91 ms │    no change │
│ QQuery 39 │  135.55 ms │                                  142.13 ms │    no change │
│ QQuery 40 │   13.28 ms │                                   12.95 ms │    no change │
│ QQuery 41 │   12.50 ms │                                   12.45 ms │    no change │
│ QQuery 42 │   11.77 ms │                                   11.90 ms │    no change │
└───────────┴────────────┴────────────────────────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 18965.84ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 19046.25ms │
│ Average Time (HEAD)                                       │   441.07ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │   442.94ms │
│ Queries Faster                                            │          0 │
│ Queries Slower                                            │          1 │
│ Queries with No Change                                    │         42 │
│ Queries with Failure                                      │          0 │
└───────────────────────────────────────────────────────────┴────────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and short-circut-and-or-not-case-when-coalesce
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃ short-circut-and-or-not-case-when-coalesce ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │           1.19 / 1.78 ±1.08 / 3.94 ms │                1.16 / 1.75 ±1.06 / 3.86 ms │     no change │
│ QQuery 1  │        12.23 / 12.32 ±0.07 / 12.41 ms │             11.79 / 12.04 ±0.14 / 12.21 ms │     no change │
│ QQuery 2  │        35.19 / 35.57 ±0.28 / 35.85 ms │             34.73 / 34.94 ±0.13 / 35.13 ms │     no change │
│ QQuery 3  │        31.66 / 32.29 ±1.04 / 34.35 ms │             31.09 / 31.99 ±0.76 / 32.92 ms │     no change │
│ QQuery 4  │     241.49 / 244.77 ±1.74 / 246.63 ms │          235.60 / 241.07 ±3.90 / 247.12 ms │     no change │
│ QQuery 5  │     279.69 / 286.96 ±5.54 / 294.42 ms │          280.52 / 284.29 ±3.34 / 289.87 ms │     no change │
│ QQuery 6  │           1.20 / 1.36 ±0.25 / 1.85 ms │                1.21 / 1.37 ±0.24 / 1.85 ms │     no change │
│ QQuery 7  │        13.29 / 14.33 ±1.18 / 16.49 ms │             13.09 / 13.23 ±0.10 / 13.36 ms │ +1.08x faster │
│ QQuery 8  │     332.66 / 338.33 ±4.23 / 344.29 ms │          326.99 / 339.78 ±8.48 / 350.81 ms │     no change │
│ QQuery 9  │     474.73 / 481.80 ±6.05 / 490.48 ms │         467.05 / 474.78 ±10.16 / 494.31 ms │     no change │
│ QQuery 10 │        66.38 / 67.22 ±0.81 / 68.72 ms │            66.26 / 73.58 ±12.66 / 98.88 ms │  1.09x slower │
│ QQuery 11 │        75.89 / 77.21 ±1.65 / 80.43 ms │             76.26 / 77.45 ±0.70 / 78.34 ms │     no change │
│ QQuery 12 │     266.81 / 273.90 ±7.82 / 288.27 ms │          266.13 / 272.38 ±5.16 / 277.73 ms │     no change │
│ QQuery 13 │    360.22 / 392.30 ±33.33 / 453.98 ms │          359.60 / 371.40 ±8.18 / 382.60 ms │ +1.06x faster │
│ QQuery 14 │     280.72 / 285.31 ±3.87 / 290.51 ms │         280.80 / 288.29 ±10.87 / 309.78 ms │     no change │
│ QQuery 15 │    289.75 / 313.74 ±36.34 / 384.88 ms │         282.70 / 297.56 ±16.86 / 329.83 ms │ +1.05x faster │
│ QQuery 16 │    620.22 / 634.09 ±10.04 / 647.65 ms │          618.95 / 627.78 ±8.64 / 642.47 ms │     no change │
│ QQuery 17 │     622.63 / 629.32 ±3.46 / 632.45 ms │          616.94 / 633.29 ±9.71 / 644.47 ms │     no change │
│ QQuery 18 │ 1218.56 / 1246.27 ±22.64 / 1282.64 ms │      1215.20 / 1236.10 ±24.53 / 1268.97 ms │     no change │
│ QQuery 19 │        27.56 / 30.85 ±5.15 / 41.10 ms │             27.58 / 32.30 ±7.35 / 46.76 ms │     no change │
│ QQuery 20 │    520.41 / 532.15 ±11.39 / 549.05 ms │         516.87 / 529.09 ±10.98 / 548.53 ms │     no change │
│ QQuery 21 │     513.01 / 518.37 ±4.80 / 525.08 ms │          514.57 / 517.83 ±2.80 / 522.26 ms │     no change │
│ QQuery 22 │   976.60 / 991.75 ±14.60 / 1018.45 ms │          986.10 / 990.25 ±3.53 / 995.77 ms │     no change │
│ QQuery 23 │ 3061.49 / 3121.15 ±39.64 / 3164.07 ms │      3127.18 / 3149.88 ±33.36 / 3215.34 ms │     no change │
│ QQuery 24 │        40.73 / 42.94 ±1.55 / 45.42 ms │             40.88 / 45.30 ±4.32 / 53.08 ms │  1.05x slower │
│ QQuery 25 │     105.32 / 107.22 ±1.91 / 110.87 ms │          105.53 / 108.39 ±3.32 / 114.27 ms │     no change │
│ QQuery 26 │        41.44 / 42.97 ±2.51 / 47.97 ms │             41.52 / 44.10 ±3.51 / 50.99 ms │     no change │
│ QQuery 27 │     511.90 / 522.37 ±5.60 / 528.06 ms │          517.37 / 521.22 ±4.61 / 530.23 ms │     no change │
│ QQuery 28 │ 2856.72 / 2879.27 ±28.27 / 2931.67 ms │      2877.99 / 2920.63 ±26.33 / 2955.09 ms │     no change │
│ QQuery 29 │       38.40 / 53.68 ±16.66 / 83.32 ms │            38.15 / 44.10 ±11.60 / 67.31 ms │ +1.22x faster │
│ QQuery 30 │     308.64 / 317.22 ±7.25 / 329.20 ms │          307.37 / 310.80 ±2.73 / 313.86 ms │     no change │
│ QQuery 31 │     278.37 / 288.24 ±8.08 / 300.49 ms │          284.42 / 289.98 ±4.91 / 298.87 ms │     no change │
│ QQuery 32 │  960.97 / 1010.95 ±43.38 / 1064.78 ms │         933.42 / 965.72 ±19.23 / 992.65 ms │     no change │
│ QQuery 33 │ 1442.20 / 1486.16 ±31.67 / 1523.17 ms │      1468.27 / 1487.41 ±14.98 / 1513.02 ms │     no change │
│ QQuery 34 │ 1457.64 / 1486.42 ±25.89 / 1524.81 ms │      1457.91 / 1479.25 ±19.33 / 1506.95 ms │     no change │
│ QQuery 35 │    288.16 / 333.61 ±80.06 / 493.56 ms │         293.51 / 319.36 ±32.39 / 373.07 ms │     no change │
│ QQuery 36 │        64.85 / 70.41 ±4.68 / 78.25 ms │             68.58 / 75.57 ±7.78 / 90.69 ms │  1.07x slower │
│ QQuery 37 │        34.31 / 37.25 ±4.65 / 46.50 ms │             34.60 / 35.78 ±2.29 / 40.35 ms │     no change │
│ QQuery 38 │        39.51 / 42.14 ±4.01 / 49.99 ms │             38.91 / 43.57 ±6.48 / 56.13 ms │     no change │
│ QQuery 39 │     135.55 / 143.20 ±6.77 / 152.61 ms │          142.13 / 157.10 ±9.22 / 170.08 ms │  1.10x slower │
│ QQuery 40 │        13.28 / 16.06 ±3.11 / 21.84 ms │             12.95 / 13.71 ±0.90 / 15.38 ms │ +1.17x faster │
│ QQuery 41 │        12.50 / 14.33 ±3.17 / 20.65 ms │             12.45 / 13.55 ±1.75 / 17.03 ms │ +1.06x faster │
│ QQuery 42 │        11.77 / 12.05 ±0.28 / 12.54 ms │             11.90 / 12.24 ±0.31 / 12.73 ms │     no change │
└───────────┴───────────────────────────────────────┴────────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                                         ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                                         │ 19469.59ms │
│ Total Time (short-circut-and-or-not-case-when-coalesce)   │ 19420.18ms │
│ Average Time (HEAD)                                       │   452.78ms │
│ Average Time (short-circut-and-or-not-case-when-coalesce) │   451.63ms │
│ Queries Faster                                            │          6 │
│ Queries Slower                                            │          4 │
│ Queries with No Change                                    │         33 │
│ Queries with Failure                                      │          0 │
└───────────────────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 100.0s
Peak memory 12.8 GiB
Avg memory 4.6 GiB
CPU user 993.8s
CPU sys 71.7s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 100.0s
Peak memory 12.1 GiB
Avg memory 4.6 GiB
CPU user 990.9s
CPU sys 73.4s
Peak spill 0 B

File an issue against this benchmark runner

@rluvaton

Copy link
Copy Markdown
Member Author

@comphead can you please review this now?

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @rluvaton. The AND half reads well next to #27471, and retrying on error is the right trade-off against classifying fallibility up front: it costs nothing until a conjunct fails. My main question is how far the user-facing promise reaches.

The guard order does not survive PushDownFilter. The two rules it runs on a WHERE clause can move a conjunct ahead of its guard before it reaches evaluate_conjunction, and a first conjunct has no decided rows to retry on. On a main build:

WHERE FilterExec result
x <> 0 AND 10 / x > 1 AND y > 1 AND y > 2 10 / CAST(x@0 AS Int64) > 1 AND x@0 != 0 AND y@1 > 2 divide by zero
s ~ '^[0-9]+$' AND CAST(s AS INT) > 10 CAST(s@0 AS Int32) > 10 AND s@0 ~ ^[0-9]+$ cast error
a > 1 AND a > 2 AND random() < 2 random() < 2 AND a@0 > 2 volatile call on every row
  • Rows 1 and 3 come from simplify_predicates. As soon as it simplifies anything, it puts every non-comparison conjunct first, volatile ones included, which reorder_predicates refuses to move.
  • Row 2 comes from reorder_predicates. It counts CAST, / and % as cheap and LIKE, regex and UDFs as expensive, while is_cheap_and_infallible treats / and narrowing casts as fallible.
  • The optimizer already says so in expr_simplifier.rs: "Unlike CASE, AND/OR do not guarantee branch-local evaluation".

So I would word the user-facing change as best effort (the guard has to reach the evaluator first, and CASE stays the guaranteed form), and add a WHERE case (inline on select.slt). Keeping conjunct positions in simplify_predicates, and letting only cheap-and-infallible conjuncts move forward in reorder_predicates, would fit a follow-up issue. The volatile reorder looks like a bug of its own.

Smaller points:

  • The evaluate_conjunction doc still describes only the threshold rule. It now also covers volatile conjuncts and the retry.
  • Follow-up: alternating AND/OR stacks the two retries, also on queries that succeed. In a > 0 AND (b > 0 OR (c > 0 AND 10 / x > 1)), with only a > 0 rejecting the x = 0 rows and no level pre-filtering, each batch can evaluate the division 5 times, 4 of them failing. This extends the right-nested OR note on #27471 and could join the cases in #27671.
  • Rust (fork) found no run on the fork for this head, so the new tests have no CI result yet.

@@ -981,7 +1001,7 @@ impl PhysicalExpr for BinaryExpr {
right,
fail_on_overflow,
// Derived from right, not serialized

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.

Stale after the rename:

Suggested change
// Derived from right, not serialized
// Derived from the children, not serialized

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment on lines +1354 to +1379
fn subtree_is_volatile(expr: &Arc<dyn PhysicalExpr>) -> bool {
let mut volatile = false;
expr.apply(|e| {
if let Some(BinaryExpr {
children_volatility: Some(v),
..
}) = e.downcast_ref::<BinaryExpr>()
{
// `BinaryExpr` itself is never volatile, only its children can be
return Ok(if v.left || v.right {
volatile = true;
TreeNodeRecursion::Stop
} else {
TreeNodeRecursion::Jump
});
}
Ok(if e.is_volatile_node() {
volatile = true;
TreeNodeRecursion::Stop
} else {
TreeNodeRecursion::Continue
})
})
.expect("infallible closure should not fail");
volatile
}

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.

A direct recursion does the same job without the captured flag, the three TreeNodeRecursion arms, the .expect in library code and the new tree_node import. create_physical_expr uses the same recursive_protection attribute:

Suggested change
fn subtree_is_volatile(expr: &Arc<dyn PhysicalExpr>) -> bool {
let mut volatile = false;
expr.apply(|e| {
if let Some(BinaryExpr {
children_volatility: Some(v),
..
}) = e.downcast_ref::<BinaryExpr>()
{
// `BinaryExpr` itself is never volatile, only its children can be
return Ok(if v.left || v.right {
volatile = true;
TreeNodeRecursion::Stop
} else {
TreeNodeRecursion::Jump
});
}
Ok(if e.is_volatile_node() {
volatile = true;
TreeNodeRecursion::Stop
} else {
TreeNodeRecursion::Continue
})
})
.expect("infallible closure should not fail");
volatile
}
#[cfg_attr(feature = "recursive_protection", recursive::recursive)]
fn subtree_is_volatile(expr: &Arc<dyn PhysicalExpr>) -> bool {
match expr.downcast_ref::<BinaryExpr>() {
// `BinaryExpr` itself is never volatile, only its children can be
Some(BinaryExpr {
children_volatility: Some(v),
..
}) => v.left || v.right,
_ => {
expr.is_volatile_node()
|| expr.children().into_iter().any(subtree_is_volatile)
}
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done, thanks

Comment on lines +1572 to +1573
let undecided = not_false(array.as_boolean());
let undecided_count = undecided.true_count();
// Classify last: it walks the whole conjunct.
(undecided_count < array.len()
&& undecided_count as f32 / num_rows as f32 <= PRE_SELECTION_THRESHOLD
&& !is_cheap_and_infallible(conjunct, schema))
.then_some(undecided)
(undecided.true_count() < array.len()).then_some(undecided)

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.

rows_to_filter_before counts this mask again right after (line 1559), so each conjunct now pays two popcounts per batch. has_false ignores NULLs, so it gives the same answer, stops at the first false, and skips building the mask when nothing is decided:

Suggested change
let undecided = not_false(array.as_boolean());
let undecided_count = undecided.true_count();
// Classify last: it walks the whole conjunct.
(undecided_count < array.len()
&& undecided_count as f32 / num_rows as f32 <= PRE_SELECTION_THRESHOLD
&& !is_cheap_and_infallible(conjunct, schema))
.then_some(undecided)
(undecided.true_count() < array.len()).then_some(undecided)
let array = array.as_boolean();
array.has_false().then(|| not_false(array))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment on lines +8164 to +8168
// col_1 < 0 is false for every row
let expr = and(
col_1_lt(0.0),
and(col_1_gt_eq(0.0), Arc::clone(&probe) as _),
);

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.

col_1 < 0 is the top-level left, so evaluation stops at the if in evaluate_conjunction and never enters the inner AND, the same path as and_rhs_not_evaluated_when_lhs_all_false. Changing && to & in for_each_conjunct would pass. Swapping the two comparisons reaches the inner short-circuit:

Suggested change
// col_1 < 0 is false for every row
let expr = and(
col_1_lt(0.0),
and(col_1_gt_eq(0.0), Arc::clone(&probe) as _),
);
// col_1 >= 0 is true for every row, so the inner `AND` runs, and
// col_1 < 0 is false for every row
let expr = and(
col_1_gt_eq(0.0),
and(col_1_lt(0.0), Arc::clone(&probe) as _),
);

Similarly, the two *_infallible_rhs_evaluated_at_most_once AND tests never fail and are not volatile, so they don't reach the new code. evaluate_recorded_conjunction already asserts that each conjunct runs once, in order, for left-deep, right-deep and balanced trees.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Swapped the comparisons and removed the two AND infallible tests

Comment on lines +1746 to +1747
# `1 / y` and `1 / x` are only evaluated on the rows that need them, so the
# division by zero is short-circuited (https://github.com/apache/datafusion/issues/8927)

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.

With 3 of 5 rows left by y > 0, the division is above PRE_SELECTION_THRESHOLD, so it runs on the whole batch, fails and is retried. Worded like the OR comment below:

Suggested change
# `1 / y` and `1 / x` are only evaluated on the rows that need them, so the
# division by zero is short-circuited (https://github.com/apache/datafusion/issues/8927)
# The divisions fail on the whole batch (`y = 0`), so they are retried on the
# undecided rows only (https://github.com/apache/datafusion/issues/8927)

Two cases here would pin what nothing tests yet:

  • A WHERE clause, which goes through PushDownFilter and keeps y@1 > 0 first in the plan: SELECT * FROM t WHERE y > 0 AND 1 / y < 1. It fails on main.
  • A retry that still fails, because row (4, 0) stays undecided: a query error for SELECT x > 0 AND 1 / y < 1 FROM t. No unit test reaches this either, since FailOnUnneeded only fails on unneeded rows, so a retry that swallowed its error would pass every test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the comment and added both, the WHERE case with an EXPLAIN so a plan change that moves the division first shows up there

@mbutrovich mbutrovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @rluvaton, the AND half lines up well with the OR change.

The 55.0.0 upgrade guide already tells users not to rely on short-circuit evaluation of AND or OR, and to use CASE when a predicate can fail. That backs the best-effort wording that @comphead suggested in #27302 (review). Could the "Are there any user-facing changes?" section say that per-row evaluation is best effort and link that section of the guide? As written, "Queries like x != 0 AND 1 / x > 1 no longer fail" promises more than the guide does, and WHERE x <> 0 AND 10 / x > 1 AND y > 1 AND y > 2 still fails with divide by zero at this commit.

@rluvaton

rluvaton commented Nov 24, 2026 •

Copy link
Copy Markdown
Member Author

@comphead Thanks! Updated the user-facing section to say it's best effort and link the upgrade guide, added the WHERE case, and updated the evaluate_conjunction doc.

Opened #27722 for the alternating AND/OR retries.

also I enabled the github actions on my fork

@rluvaton

Copy link
Copy Markdown
Member Author

@mbutrovich Thanks! Updated the section to say it's best effort and link the upgrade guide

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

Labels

physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants