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

chenglei updated PHOENIX-6798:
------------------------------
    Description: 
For HBase, reversed scan is slower than normal forward scan.

Consider following table:
{code}
  create table test_table  
  (group_id integer not null, 
    keyword varchar not null, 
    cost integer, 
    CONSTRAINT TEST_PK PRIMARY KEY (group_id,keyword))
{code}

For the following sql :
{code}
   select keyword,sum(cost) from test group by keyword order by keyword desc
{code}

The compiled {{AggregatePlan}} would set the scan for HBase as reversed scan, 
but that is very strange, because for this sql, {{GroupBy.isOrderPreserving}} 
is false, we have no need to set the scan as reversed scan because we have to 
hash-aggregate the scanned results from HBase in {{Coprocessor}} before sending 
them to client.


  was:
For HBase, reversed scan is slower than normal forward scan.

Consider following table:
{code}
  create table test_table  
  (group_id integer not null, 
    keyword varchar not null, 
    cost integer, 
    CONSTRAINT TEST_PK PRIMARY KEY (group_id,keyword))
{code}

For the following sql :
{code}
   select keyword,sum(cost) from test group by keyword order by keyword desc
{code}

The compiled {{AggregatePlan}} would set the scan for HBase as reversed scan, 
but that is very strange, because for this sql, {{GroupBy.isOrderPreserving}} 
is false, we have no need to set the scan as reversed scan because we have to 
hash-aggregate the scanned results from HBase.



> Eliminate unnecessary reversed scan
> -----------------------------------
>
>                 Key: PHOENIX-6798
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6798
>             Project: Phoenix
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 5.1.2
>            Reporter: chenglei
>            Assignee: chenglei
>            Priority: Major
>
> For HBase, reversed scan is slower than normal forward scan.
> Consider following table:
> {code}
>   create table test_table  
>   (group_id integer not null, 
>     keyword varchar not null, 
>     cost integer, 
>     CONSTRAINT TEST_PK PRIMARY KEY (group_id,keyword))
> {code}
> For the following sql :
> {code}
>    select keyword,sum(cost) from test group by keyword order by keyword desc
> {code}
> The compiled {{AggregatePlan}} would set the scan for HBase as reversed scan, 
> but that is very strange, because for this sql, {{GroupBy.isOrderPreserving}} 
> is false, we have no need to set the scan as reversed scan because we have to 
> hash-aggregate the scanned results from HBase in {{Coprocessor}} before 
> sending them to client.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to