Commit 13bc8f0
authored
If you write very very large ESQL queries you can spend a lot of memory
on the expression evaluators themselves. You can certainly do it in real
life, but our tests do something like:
```
FROM foo
| EVAL a0001 = n + 1
| EVAL a0002 = a0001 + 1
| EVAL a0003 = a0002 + 1
...
| EVAL a5000 = a4999 + 1
| STATS MAX(a5000)
```
Each evaluator costs like 200 bytes a pop. For thousands of evaluators
this adds up. So! We have to track it.
Nhat had suggested charging a flat 200 bytes a pop. I thought about it
and decided that it'd be pretty easy to get the actual size. Most of the
evaluators are generated and it's a fairly small generated change to
pick that up. So I did.
We *do* build the evaluators before we cost them, but that's fine
because they are very very small. So long as we account for them, I
think it's safe.
1 parent 4b90302 commit 13bc8f0
File tree
461 files changed
+8210
-375
lines changed- benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator
- docs
- changelog
- reference/query-languages/esql
- _snippets/functions
- description
- parameters
- kibana
- definition/functions
- docs/functions
- x-pack/plugin
- esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression
- esql
- compute
- gen/src/main/java/org/elasticsearch/compute/gen
- src
- main/java/org/elasticsearch/compute
- lucene
- operator
- mvdedupe
- test/java/org/elasticsearch/compute
- aggregation
- lucene
- read
- operator
- src
- main
- generated-src/org/elasticsearch/xpack/esql/expression
- function/scalar/nulls
- predicate/operator/comparison
- generated/org/elasticsearch/xpack/esql/expression
- function/scalar
- conditional
- convert
- date
- ip
- math
- multivalue
- spatial
- string
- predicate
- logical
- operator
- arithmetic
- comparison
- java/org/elasticsearch/xpack/esql
- evaluator
- mapper
- expression
- function/scalar
- conditional
- convert
- multivalue
- nulls
- util
- predicate
- nulls
- operator/comparison
- inference
- planner
- test/java/org/elasticsearch/xpack/esql
- expression/function
- scalar
- conditional
- nulls
- inference
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
461 files changed
+8210
-375
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
669 | 674 | | |
670 | 675 | | |
671 | 676 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
172 | 187 | | |
173 | 188 | | |
174 | 189 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
126 | 143 | | |
127 | 144 | | |
128 | 145 | | |
| |||
411 | 428 | | |
412 | 429 | | |
413 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
414 | 436 | | |
415 | 437 | | |
416 | 438 | | |
| |||
535 | 557 | | |
536 | 558 | | |
537 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
538 | 565 | | |
539 | 566 | | |
540 | 567 | | |
| |||
667 | 694 | | |
668 | 695 | | |
669 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
670 | 704 | | |
671 | 705 | | |
672 | 706 | | |
| |||
769 | 803 | | |
770 | 804 | | |
771 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
772 | 809 | | |
773 | 810 | | |
774 | 811 | | |
| |||
853 | 890 | | |
854 | 891 | | |
855 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
856 | 896 | | |
857 | 897 | | |
858 | 898 | | |
| |||
940 | 980 | | |
941 | 981 | | |
942 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
943 | 988 | | |
944 | 989 | | |
945 | 990 | | |
| |||
1085 | 1130 | | |
1086 | 1131 | | |
1087 | 1132 | | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1088 | 1145 | | |
1089 | 1146 | | |
1090 | 1147 | | |
| |||
0 commit comments