ClickHouse / ClickHouse/ClickHouse

Optimize injective functions with several arguments inside of Uniq functions

Open
#65,674 1 comment 1 reaction 0 assignees View on GitHub
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

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.