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

Eli Levine commented on PHOENIX-2214:
-------------------------------------

Come to think of it, ORDER BY can be optimized away for queries that only 
include the parts of the PK not already bound in the WHERE clause of the view's 
DDL, such as "SELECT * FROM v2 order by k2" (refer to the patch for V2's DDL). 
What do you think, [~jamestaylor]?

> ORDER BY optimization incorrect for queries over views containing WHERE clause
> ------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2214
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2214
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.1
>            Reporter: Eli Levine
>         Attachments: 
> 0001-Test-case-to-outline-issue-with-view-ORDER-BY-optimi.patch
>
>
> Phoenix optimizes away ORDER BY clauses if they are the same order as the 
> default PK order. However, this optimization is not done correctly for views 
> (tenant-specific and regular) if the view has been created with a WHERE 
> clause.
> See attached patch for repro, in which the last assertEquals() fails due to 
> the fact that ORDER BY is not optimized away, as expected.



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

Reply via email to