You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "jay wong (JIRA)" <ji...@apache.org> on 2014/05/29 07:56:01 UTC

[jira] [Commented] (PHOENIX-1006) 8x Performance enhancements in my group by query case.

    [ https://issues.apache.org/jira/browse/PHOENIX-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14012100#comment-14012100 ] 

jay wong commented on PHOENIX-1006:
-----------------------------------

previously, the RT depends on the groups num.

Now the Aggregating is parallel. the RT depends on server runtime


> 8x Performance enhancements in my group by query case.
> ------------------------------------------------------
>
>                 Key: PHOENIX-1006
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1006
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: jay wong
>         Attachments: PHOENIX-1006.patch
>
>
> As a query sql is :
> SELECT count(1) as count,SUM(int_column) as sum_column, MAX(int_column) as max_column2,MIN(int_column) as min_column,AVG(int_column) as avg_column FROM table1 WHERE int_column IS NOT NULL  GROUP BY int_column2 ORDER BY int_column DESC LIMIT 200;
> NOTE: The result has 55000 groups. 
> AggregatePlan tell me when match group by. the resultIterator will be set as MergeSortRowKeyResultIterator.
> And the MergeSortRowKeyResultIterator need a OrderedResultIterator.
> So when you run a group by query with order or not . It ALWAYS has a ordered First.
> I think it's unnecessary at all.
> So I get all result from RegionServer and Aggregate by key.
> with the above sql. the execute RT is from 30s enhancements to 4s.
> ==============================================
> But I found If group by without order by. the result sequence could not be safeguarded.
> So the result sequence I sort by TreeSet with key.
> Now the result is same as query with  MergeSortRowKeyResultIterator



--
This message was sent by Atlassian JIRA
(v6.2#6252)