You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@quickstep.apache.org by "Zuyu Zhang (JIRA)" <ji...@apache.org> on 2018/04/23 20:09:00 UTC

[jira] [Updated] (QUICKSTEP-118) Optimization Rule For Union of same subqueries

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

Zuyu Zhang updated QUICKSTEP-118:
---------------------------------
    Description: 
Currently, [the following query|https://github.com/apache/incubator-quickstep/blob/master/query_optimizer/tests/physical_generator/Select.test#L3156] is convert into a `UnionAll` followed by `Aggregate` for de-duplication.
{code:java}
SELECT int_col FROM test
UNION
SELECT int_col FROM test;
{code}
 

The optimizer should, however, transform such query into a simple aggregate query:
{code:java}
SELECT int_col FROM test GROUP BY int_col;
{code}

  was:
Currently, [the following query|https://github.com/apache/incubator-quickstep/blob/master/query_optimizer/tests/physical_generator/Select.test#L3156] is convert into a `UnionAll` followed by `Aggregate` for de-duplication.
{code:java}
SELECT int_col FROM test
UNION
SELECT int_col FROM test;
{code}
 

The optimizer should, however, transform such query into a simple select query:
{code:java}
SELECT int_col FROM test GROUP BY int_col;
{code}


> Optimization Rule For Union of same subqueries
> ----------------------------------------------
>
>                 Key: QUICKSTEP-118
>                 URL: https://issues.apache.org/jira/browse/QUICKSTEP-118
>             Project: Apache Quickstep
>          Issue Type: Improvement
>          Components: Query Optimizer
>            Reporter: Zuyu Zhang
>            Priority: Minor
>
> Currently, [the following query|https://github.com/apache/incubator-quickstep/blob/master/query_optimizer/tests/physical_generator/Select.test#L3156] is convert into a `UnionAll` followed by `Aggregate` for de-duplication.
> {code:java}
> SELECT int_col FROM test
> UNION
> SELECT int_col FROM test;
> {code}
>  
> The optimizer should, however, transform such query into a simple aggregate query:
> {code:java}
> SELECT int_col FROM test GROUP BY int_col;
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)