James Taylor created PHOENIX-1589:
-------------------------------------
Summary: 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
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)