ClickHouse / ClickHouse/ClickHouse
sumMap/minMap/maxMap aggregation optimization for sorted keys
Open
comp-aggregate-functions
external
feature
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
In my business, I store a sparse Array into ClickHouse with two columns. e.g.
```
CREATE TABLE sparse_array(
array_index Array(Int32),
array_value Array(Int32)
) ENGINE = Log;
```
Now, I want to merge the Array, so I use sumMap aggregation function. e.g.
```
SELECT
sumMap(array_index, array_value)
FROM sparse_array
```
But the performance of the aggregation is not good enough for me.
I find that sumMap use a map to calculate the result for sumMap aggregation. I think if the key argument Array is sorted, it should get a better performance for the aggregation.
Contributor guide
Assessment
This issue has not been assessed yet.