Commit 5c4f3ee
155064: opt: normalize LIKE ... ESCAPE r=mgartner a=mgartner
#### logictest: make test case deterministic
This commit makes a test case in `distsql_agg` deterministic no matter
how many optimizer rules have been defined. It now explicitly disables
an optimizer rule, which is required to reproduce the behavior, rather
than using the `testing_optimizer_random_seed` and
`testing_optimizer_disable_rule_probability` session settings.
Release note: None
#### opt: make scalar list custom func accessor safer
The custom functions `FirstScalarListExpr` and `SecondScalarListExpr`
have been replaced by `ScalarExprAt`. This function is safer because it
returns ok=false if the given index is out-of-bounds instead of
panicking. This function has been added to `general_funcs.go` instead of
`comp_funcs.go` in preparation for usage outside of `comp.opt`.
Release note: None
#### opt: normalize LIKE ... ESCAPE
An expression in the form `a LIKE b ESCAPE '/'`, which is parsed as
`like_escape(a, b, '/')`, is now normalized to `a LIKE b`. This is valid
because `\` is the default escape character, so the expressions are
equivalent.
This normalization allows for further optimization, for example:
```sql
CREATE TABLE t (s STRING, INDEX (s));
EXPLAIN SELECT s FROM t WHERE s LIKE 'foo\_bar' ESCAPE '\';
-- BEFORE:
-- • filter
-- │ filter: like_escape(s, e'foo\\_bar', e'\\')
-- │
-- └── • scan
-- table: t@t_pkey
-- spans: FULL SCAN
-- AFTER:
-- • scan
-- table: t@t_s_idx
-- spans: [/'foo_bar' - /'foo_bar']
```
Informs #30192
Release note (performance improvement): Queries with filters in the form
`a LIKE b ESCAPE '\'` are now index-accelerated in some cases which they
were not before.
157908: kvpb: add (*RangeFeedEvent).EventType method r=wenyihu6 a=stevendanna
A small helper for printing the type of an event since this type is enum-like.
Informs #135332
Release note: None
157956: roachtest/vecindex: Always download datasets when testing r=mw5h a=mw5h
Previously, the vecindex roachtest would use the vecann default of attempting to reuse cached dataset files. This led to a situation where a test runner apparently cached a truncated file, causing the test to fail repeatedly when run from that runner. This patch changes the behavior to always download the dataset, so the test doesn't repeatedly flake.
Fixes: #157119
Release note: None
Co-authored-by: Marcus Gartner <[email protected]>
Co-authored-by: Steven Danna <[email protected]>
Co-authored-by: Matt White <[email protected]>
File tree
10 files changed
+131
-43
lines changed- pkg
- cmd/roachtest/tests
- kv
- kvpb
- kvserver/rangefeed
- sql
- logictest/testdata/logic_test
- opt/norm
- rules
- testdata/rules
- workload/vecann
10 files changed
+131
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2185 | 2185 | | |
2186 | 2186 | | |
2187 | 2187 | | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
2188 | 2210 | | |
2189 | 2211 | | |
2190 | 2212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 100 | + | |
116 | 101 | | |
117 | 102 | | |
118 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
734 | | - | |
| 733 | + | |
735 | 734 | | |
736 | 735 | | |
737 | 736 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 79 | | |
90 | 80 | | |
91 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
661 | 677 | | |
662 | 678 | | |
663 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 229 | + | |
231 | 230 | | |
232 | 231 | | |
233 | 232 | | |
| |||
249 | 248 | | |
250 | 249 | | |
251 | 250 | | |
252 | | - | |
253 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 257 | + | |
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2689 | 2689 | | |
2690 | 2690 | | |
2691 | 2691 | | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | | - | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
136 | | - | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
182 | | - | |
| 184 | + | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| |||
0 commit comments