You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/01/24 04:15:39 UTC

[jira] [Resolved] (PHOENIX-1589) Optimize out GROUP BY if grouping by entire PK

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

James Taylor resolved PHOENIX-1589.
-----------------------------------
       Resolution: Fixed
         Assignee: James Taylor
    Fix Version/s: 4.6.0

> Optimize out GROUP BY if grouping by entire PK
> ----------------------------------------------
>
>                 Key: PHOENIX-1589
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1589
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: James Taylor
>             Fix For: 4.6.0
>
>
> For example, the following should produce a ScanPlan instead an AggregatePlan.
> {code}
> CREATE TABLE t (k INTEGER PRIMARY KEY, v VARCHAR);
> SELECT k FROM t GROUP BY k;
> {code}
> Also, equivalent to this would be:
> {code}
> SELECT DISTINCT k FROM t;
> {code}
> This will help improve performance when a query rewrite occurs to join an index back to the data table (when it's hinted):
> {code}
> CREATE TABLE t (k INTEGER PRIMARY KEY, 
>     v1 VARCHAR, v2 VARCHAR);
> CREATE INDEX i ON (v1);
> SELECT /*+ INDEX(T, I) */ k, v1, v2 FROM t;
> {code}



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