ClickHouse / ClickHouse/ClickHouse

sumMap/minMap/maxMap aggregation optimization for sorted keys

Open
#23,485 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.