Commit d28a03c
authored
Adjust
## Which issue does this PR close?
- Related to #11570.
## 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?
Nocase_when DivideByZeroProtection benchmark so that "percentage of zeroes" corresponds to "number of times protection is needed" (#20105)1 parent 7388eed commit d28a03c
2 files changed
Lines changed: 22 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
568 | 567 | | |
569 | 568 | | |
570 | 569 | | |
| |||
578 | 577 | | |
579 | 578 | | |
580 | 579 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
| 580 | + | |
610 | 581 | | |
611 | 582 | | |
612 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
624 | 645 | | |
625 | 646 | | |
626 | 647 | | |
| |||
0 commit comments