You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by pb...@apache.org on 2019/05/28 22:01:51 UTC

[phoenix] 04/04: PHOENIX-5112 Simplify QueryPlan selection in Phoenix.

This is an automated email from the ASF dual-hosted git repository.

pboado pushed a commit to branch 4.x-HBase-1.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git

commit 68d1a04f1c80212a6fe6dd9574de9c34ad39b779
Author: Lars Hofhansl <la...@apache.org>
AuthorDate: Sat May 25 02:55:09 2019 +0100

    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();