You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Istvan Toth (Jira)" <ji...@apache.org> on 2023/08/01 06:56:00 UTC

[jira] [Commented] (PHOENIX-5744) wrong results when using the local secondary index

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

Istvan Toth commented on PHOENIX-5744:
--------------------------------------

Please add a full repro.
i.e., full create statements for the table and index and upserts for enough rows to repro the issue.

> wrong results when using the local secondary index
> --------------------------------------------------
>
>                 Key: PHOENIX-5744
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5744
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: oktay tuncay
>            Priority: Critical
>
> If the PK column(s) is included in the local index script and this column order by condition is also used, wrong result issue occurs.
> Workaround: NO_INDEX hint
> Example:
> PK columns: ID, CREATETIME
> SECONDARY INDEX: CREATETIME,TYPE2, KEY, SEQ_NUM, ...
> Query 1: works properly and returns 4 rows
> select /*+ NO_INDEX */ ID, TYPE, JOB, CON_ID, CREATETIME, TYPE2, KEY, SEQ_NUM FROM owner.table_name WHERE KEY='AAA' order by CREATETIME desc;
> Query 2: wrong result, shows 1 rows
> select /*+ NO_INDEX */ ID, TYPE, JOB, CON_ID, CREATETIME, TYPE2, KEY, SEQ_NUM FROM owner.table_name WHERE KEY='AAA' order by CREATETIME desc;



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