[ https://issues.apache.org/jira/browse/PHOENIX-2814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15322940#comment-15322940 ]
Samarth Jain commented on PHOENIX-2814: --------------------------------------- Agreed. This should be fixed once PHOENIX-2276 is fixed. I am working on changing the row key structure of shared indexes like local indexes and indexes on views to VIEW_INDEX_ID, TENANT_ID, .. rest of PK. > WhereOptimizer does not handle multi-tenant local index correctly when > connection is non-tenant-specific > -------------------------------------------------------------------------------------------------------- > > Key: PHOENIX-2814 > URL: https://issues.apache.org/jira/browse/PHOENIX-2814 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.7.0 > Reporter: Maryann Xue > Assignee: rajeshbabu > Priority: Minor > Fix For: 4.8.0 > > > For example, if we have a multi-tenant table "A" with columns: tenant_id, id, > col0, col1, PK as (tenant_id, id) > A local index table IDX_A created on A(col0) including col1. > > Then if we try to use IDX_A for query "select * from A where tenant_id = '10' > and col0 < 20", WhereOptimizer will compile this into a wrong ScanRanges > object since _INDEX_ID column comes after TENANT_ID and using the PK start > position approach just won't address this case properly. See > {{WhereOptimizer.KeyExpressionVisitor.andKeySlots()}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)