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 2019/04/10 19:20:00 UTC
[jira] [Commented] (CALCITE-896) Remove Aggregate if grouping
columns are unique and all functions are splittable
[ https://issues.apache.org/jira/browse/CALCITE-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16814812#comment-16814812 ]
Julian Hyde commented on CALCITE-896:
-------------------------------------
Will do.
> Remove Aggregate if grouping columns are unique and all functions are splittable
> --------------------------------------------------------------------------------
>
> Key: CALCITE-896
> URL: https://issues.apache.org/jira/browse/CALCITE-896
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Priority: Major
> Labels: pull-request-available
> Attachments: node.png
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Remove Aggregate if grouping columns are unique and all functions are splittable. Currently AggregateRemoveRule is only applied if there are no aggregate functions. But we could optimize
> {code}select deptno, count(name) from dept group by deptno{code}
> to
> {code}select deptno, 1 from dept{code}
> because we know deptno is unique, name is not null, and a singleton count applied to a not null column evaluates to 1.
> See AggregateJoinTransposeRule; it already makes use of SqlSplittableAggFunction.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)