Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/3#discussion_r14860115 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java --- @@ -1134,8 +1135,15 @@ public static SelectStatement optimize(PhoenixStatement statement, SelectStateme List<OrderByNode> orderBy = tableRef.equals(orderByTableRef) ? select.getOrderBy() : null; SelectStatement stmt = getSubqueryForOptimizedPlan(select.getHint(), table.getDynamicColumns(), tableRef, join.getColumnRefs(), table.getPreFiltersCombined(), groupBy, orderBy, table.isWildCardSelect()); QueryPlan plan = statement.getConnection().getQueryServices().getOptimizer().optimize(statement, stmt); + boolean localIndex = plan.getContext().getCurrentTable().getTable().getIndexType()==IndexType.LOCAL; if (!plan.getTableRef().equals(tableRef)) { - replacement.put(tableRef, plan.getTableRef()); + // Use local index plan only when all the columns to project are available in index. --- End diff -- Not sure I understand this comment. This code applies to joins, I believe. Can you confirm/elaborate? Is the TODO still relavent?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---