Commit 9422b5a
authored
Avoid O(N^2) in VALUES with ordinals grouping (elastic#130576) (elastic#130773)
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 e26dbc2 commit 9422b5a
File tree
14 files changed
+678
-313
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
14 files changed
+678
-313
lines changedLines changed: 27 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
119 | 140 | | |
120 | 141 | | |
121 | 142 | | |
| |||
314 | 335 | | |
315 | 336 | | |
316 | 337 | | |
317 | | - | |
| 338 | + | |
318 | 339 | | |
319 | 340 | | |
320 | | - | |
| 341 | + | |
321 | 342 | | |
322 | | - | |
| 343 | + | |
323 | 344 | | |
324 | 345 | | |
325 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 117 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments