This is an automated email from the ASF dual-hosted git repository. larsh pushed a commit to branch 4.x-HBase-1.5 in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push: new 20b3b67 PHOENIX-5112 Simplify QueryPlan selection in Phoenix. 20b3b67 is described below commit 20b3b679024e13b34fe17ab556e03e02cc660899 Author: Lars Hofhansl <la...@apache.org> AuthorDate: Fri May 24 18:51:28 2019 -0700 PHOENIX-5112 Simplify QueryPlan selection in Phoenix. --- .../org/apache/phoenix/optimize/QueryOptimizer.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java b/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java index 43a5950..4f0dfeb 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java @@ -324,24 +324,6 @@ public class QueryOptimizer { QueryPlan plan = compiler.compile(); - boolean optimizedSort = - plan.getOrderBy().getOrderByExpressions().isEmpty() - && !dataPlan.getOrderBy().getOrderByExpressions().isEmpty() - || plan.getGroupBy().isOrderPreserving() - && !dataPlan.getGroupBy().isOrderPreserving(); - - // If query doesn't have where clause, or the planner didn't add any (bound) scan ranges, and some of - // columns to project/filter are missing in the index then we need to get missing columns from main table - // for each row in local index. It's like full scan of both local index and data table which is inefficient. - // Then we don't use the index. If all the columns to project are present in the index - // then we can use the index even the query doesn't have where clause. - // We'll use the index anyway if it allowed us to avoid a sort operation. - if (index.getIndexType() == IndexType.LOCAL - && (indexSelect.getWhere() == null - || plan.getContext().getScanRanges().getBoundRanges().size() == 1) - && !plan.getContext().getDataColumns().isEmpty() && !optimizedSort) { - return null; - } indexTableRef = plan.getTableRef(); indexTable = indexTableRef.getTable(); indexState = indexTable.getIndexState();