Commit 59df1bf
authored
Avoid O(N^2) in VALUES with ordinals grouping (elastic#130576)
Using the VALUES aggregator with ordinals grouping led to accidental
quadratic complexity. Queries like FROM .. | STATS ... VALUES(field) ...
BY keyword-field are affected by this performance issue. This change
caches a sorted structure - previously used to fix a similar O(N^2)
problem when emitting the output block - during the merging phase of the
OrdinalGroupingOperator.1 parent 02b2f5e commit 59df1bf
File tree
15 files changed
+569
-220
lines changed- benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator
- docs/changelog
- x-pack/plugin/esql/compute/src/main
- generated-src/org/elasticsearch/compute/aggregation
- generated/org/elasticsearch/compute/aggregation
- java/org/elasticsearch/compute
- aggregation
- operator
15 files changed
+569
-220
lines changedLines changed: 27 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
128 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
| |||
331 | 352 | | |
332 | 353 | | |
333 | 354 | | |
334 | | - | |
| 355 | + | |
335 | 356 | | |
336 | 357 | | |
337 | | - | |
| 358 | + | |
338 | 359 | | |
339 | | - | |
| 360 | + | |
340 | 361 | | |
341 | 362 | | |
342 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 99 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments