Commit 998354b
authored
Add batched streaming aggregations (#324)
* Add batched streaming aggregations
With the current model we expect each Next call to return samples
for unique steps. This approach works well because of its simplicity,
but for high cardinality queries (100K+ series), it tends to use a lot
of memory because the buffers for each step tend to be big.
This commit resolves that by allowing the aggregate to handle batches
from the same step coming from subsequent Next calls. Selectors are expanded
with a batchSize parameter which can be injected when a streaming aggregate is
present in the plan. Using this parameter then can put an upper limit on
the size of the output vectors they produce.
Signed-off-by: Filip Petkovski <[email protected]>
* Remove unused method
Signed-off-by: Filip Petkovski <[email protected]>
* Fix traverse
Signed-off-by: Filip Petkovski <[email protected]>
* Fix acceptance tests
Signed-off-by: Filip Petkovski <[email protected]>
* Add group test and fix failure
Signed-off-by: Filip Petkovski <[email protected]>
---------
Signed-off-by: Filip Petkovski <[email protected]>1 parent fcf8381 commit 998354b
File tree
19 files changed
+675
-294
lines changed- engine
- execution
- aggregate
- exchange
- remote
- scan
- logicalplan
19 files changed
+675
-294
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
97 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
98 | 107 | | |
| 108 | + | |
| 109 | + | |
99 | 110 | | |
100 | | - | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
| |||
274 | 285 | | |
275 | 286 | | |
276 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
277 | 300 | | |
278 | 301 | | |
279 | 302 | | |
280 | 303 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 304 | + | |
| 305 | + | |
290 | 306 | | |
291 | 307 | | |
292 | 308 | | |
293 | 309 | | |
294 | | - | |
| 310 | + | |
295 | 311 | | |
296 | 312 | | |
297 | 313 | | |
| |||
303 | 319 | | |
304 | 320 | | |
305 | 321 | | |
306 | | - | |
| 322 | + | |
307 | 323 | | |
308 | 324 | | |
309 | 325 | | |
| |||
562 | 578 | | |
563 | 579 | | |
564 | 580 | | |
565 | | - | |
566 | | - | |
| 581 | + | |
| 582 | + | |
567 | 583 | | |
568 | 584 | | |
569 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
183 | 192 | | |
184 | 193 | | |
185 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1103 | 1103 | | |
1104 | 1104 | | |
1105 | 1105 | | |
1106 | | - | |
1107 | | - | |
| 1106 | + | |
| 1107 | + | |
1108 | 1108 | | |
1109 | 1109 | | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1110 | 1117 | | |
1111 | 1118 | | |
1112 | 1119 | | |
| |||
1907 | 1914 | | |
1908 | 1915 | | |
1909 | 1916 | | |
| 1917 | + | |
| 1918 | + | |
1910 | 1919 | | |
1911 | 1920 | | |
1912 | 1921 | | |
| |||
1920 | 1929 | | |
1921 | 1930 | | |
1922 | 1931 | | |
1923 | | - | |
| 1932 | + | |
1924 | 1933 | | |
1925 | 1934 | | |
1926 | 1935 | | |
| |||
4667 | 4676 | | |
4668 | 4677 | | |
4669 | 4678 | | |
4670 | | - | |
| 4679 | + | |
4671 | 4680 | | |
4672 | 4681 | | |
4673 | 4682 | | |
| |||
0 commit comments