You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/06/01 20:32:17 UTC

[jira] [Resolved] (CALCITE-732) Implement multiple distinct-COUNT using GROUPING SETS

     [ https://issues.apache.org/jira/browse/CALCITE-732?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-732.
---------------------------------

Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/3e50232b.

> Implement multiple distinct-COUNT using GROUPING SETS
> -----------------------------------------------------
>
>                 Key: CALCITE-732
>                 URL: https://issues.apache.org/jira/browse/CALCITE-732
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>             Fix For: 1.4.0-incubating
>
>
> Currently if a query has COUNT(DISTINCT x) and COUNT(DISTINCT y) we compute the distinct counts separately and combine them using a join. The join isn't too expensive (because usually the GROUP BY has only a few keys) but we make multiple scans over the base table.
> I think we could translate multiple distinct-counts into a GROUPING SETS query (i.e. an Aggregate with more than one element in the groupSets field). If the underlying engine can evaluate that efficiently, then we have saved ourselves a join and several scans.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)