phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maryann Xue (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (PHOENIX-3498) Query with index failed when query back to data table with desc PK column
Date Fri, 18 Nov 2016 18:36:59 GMT

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

Maryann Xue edited comment on PHOENIX-3498 at 11/18/16 6:36 PM:
----------------------------------------------------------------

+1 to the patch. Thank you very much for fixing this issue, [~yhxx511]! I'll go ahead and
commit it.


was (Author: maryannxue):
+1 to the patch. Thank you very much for fixing this issue, [~yhxx511]!

> Query with index failed when query back to data table with desc PK column
> -------------------------------------------------------------------------
>
>                 Key: PHOENIX-3498
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3498
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: William Yang
>            Assignee: William Yang
>         Attachments: PHOENIX-3498.patch
>
>
> This bug can be re-pro against two conditions:
> 1. select must hit index table and have to query back to data table
> 2. at least one of the data table's PK column is in DESC order
> see the following SQLs:
> {code}
> create table tt (p1 integer not null, p2 integer not null, a integer, b integer constraint
pk primary key (p1,p2));
> create index tti on tt (a);
> upsert into tt values (0, 1, 2, 3);
> select /*+index(tt tti)*/ b from tt where a = 2;         // will query back to data table
> //this SELECT works fine, will return b=3 
> {code}
> if we declare ether p1/p2 as DESC, then the same SELECT will return nothing. 
> {code}
> create table tt (p1 integer not null, p2 integer not null, a integer, b integer constraint
pk primary key (p1 desc, p2));
> create index tti on tt (a);
> upsert into tt values (0, 1, 2, 3);
> select /*+index(tt tti)*/ b from tt where a = 2;  // return nothing
> {code}
> if p1 is not DESC, but p2 is, SELECT will fail too.



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

Mime
View raw message