You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/07/10 14:33:04 UTC

[jira] [Commented] (PHOENIX-933) Local index support to Phoenix

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

ASF GitHub Bot commented on PHOENIX-933:
----------------------------------------

Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/1#discussion_r14762643
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/compile/TrackOrderPreservingExpressionCompiler.java ---
    @@ -69,6 +70,7 @@
             boolean isSharedViewIndex = table.getViewIndexId() != null;
             // TODO: util for this offset, as it's computed in numerous places
             positionOffset = (isSalted ? 1 : 0) + (isMultiTenant ? 1 : 0) + (isSharedViewIndex ? 1 : 0);
    +        this.isOrderPreserving &= table.getIndexType() != IndexType.LOCAL;
    --- End diff --
    
    One thing that's necessary, though, to maintain rows in row key order is to modify ScanPlan.java:118 to do a merge sort instead of a concat:
    
                if ((isSalted || isLocalIndex) &&
                        (context.getConnection().getQueryServices().getProps().getBoolean(
                                QueryServices.ROW_KEY_ORDER_SALTED_TABLE_ATTRIB,
                                QueryServicesOptions.DEFAULT_ROW_KEY_ORDER_SALTED_TABLE) ||
                         orderBy == OrderBy.FWD_ROW_KEY_ORDER_BY ||
                         orderBy == OrderBy.REV_ROW_KEY_ORDER_BY)) { // ORDER BY was optimized out b/c query is in row key order
                    scanner = new MergeSortRowKeyResultIterator(iterators, SaltingUtil.NUM_SALTING_BYTES, orderBy == OrderBy.REV_ROW_KEY_ORDER_BY);
                } else {
                    scanner = new ConcatResultIterator(iterators);
                }
    
    Local indexes are similar to salted tables in that the parallel scans will all be within a region, ordered correctly. As long as we do a merge sort across the results of these scans, the rows will be ordered correctly.


> Local index support to Phoenix
> ------------------------------
>
>                 Key: PHOENIX-933
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-933
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: rajeshbabu
>
> Hindex(https://github.com/Huawei-Hadoop/hindex) provides local indexing support to HBase. It stores region level index in a separate table, and co-locates the user and index table regions with a custom load balancer.
> See http://goo.gl/phkhwC and http://goo.gl/EswlxC for more information. 
> This JIRA addresses the local indexing solution integration to phoenix.



--
This message was sent by Atlassian JIRA
(v6.2#6252)