Skip to content

Optimize queries with distinct aggregations over different columns #19878

Description

@hariso

In #19715, we optimize queries where one or more distinct aggregations use the same column.

We have another case, which are aggregations with different columns, e.g.

SELECT COUNT(DISTINCT RegionID), COUNT(DISTINCT UserID) 
FROM hits 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions