Skip to content

Conversation

@pepijnve
Copy link
Contributor

@pepijnve pepijnve commented Feb 2, 2026

Which issue does this PR close?

Rationale for this change

The case_when microbenchmark that covers the pattern CASE WHEN d != 0 THEN n / d ELSE NULL END pattern is parameterised over the percentage of zeroes in the d column. The benchmark uses the condition d > 0 rather than d != 0 though which is a bit misleading. In the '0% zeroes' run one would expect the else branch to never be taken, but because slightly less than 50% of the d values is negative, it's still taken 50% of the time.

This PR adjust the benchmark to use d != 0 instead.

What changes are included in this PR?

  • Adjust the divide by zero benchmark to use d != 0 as condition
  • Remove the duplicate benchmark, the div-by-zero variant is sufficient to compare changes across branches
  • Add a couple of SLTs to cover the CASE pattern

Are these changes tested?

Manual testing

Are there any user-facing changes?

No

@github-actions github-actions bot added physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt) labels Feb 2, 2026
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.

1 participant