ClickHouse / ClickHouse/ClickHouse
Optimize injective functions with several arguments inside of Uniq functions
Open
comp-query-analyzer
feature
performance
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
Right now CH removes injective functions from `uniq*` arguments only if they have exactly 1 argument.
We can also optimize it when the injective function has several arguments.
**Example**
```sql
SELECT uniq(number + 1) FROM numbers(3);
```
Can be optimized to:
```sql
SELECT uniq(number) FROM numbers(3);
```
Contributor guide
Assessment
This issue has not been assessed yet.