Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 c0bc570f4 -> 452c79993


PHOENIX-2724 Query with large number of guideposts is slower compared to no 
stats.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/452c7999
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/452c7999
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/452c7999

Branch: refs/heads/4.x-HBase-0.98
Commit: 452c79993d66b49f8c8454ca8e67e9526176b005
Parents: c0bc570
Author: Lars Hofhansl <la...@apache.org>
Authored: Sun Jul 3 23:41:43 2016 -0700
Committer: Lars Hofhansl <la...@apache.org>
Committed: Sun Jul 3 23:41:43 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/phoenix/iterate/BaseResultIterators.java   | 4 ++--
 .../org/apache/phoenix/schema/stats/GuidePostsInfoBuilder.java | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/452c7999/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index e3d512f..523b419 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -638,7 +638,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
                     keyOffset = 
ScanUtil.getRowKeyOffset(regionInfo.getStartKey(), endRegionKey);
                 }
                 try {
-                    while (guideIndex < gpsSize && 
(currentGuidePost.compareTo(endKey) <= 0 || endKey.length == 0)) {
+                    while (guideIndex < gpsSize && (endKey.length == 0 || 
currentGuidePost.compareTo(endKey) <= 0)) {
                         Scan newScan = scanRanges.intersectScan(scan, 
currentKeyBytes, currentGuidePostBytes, keyOffset,
                                 false);
                         if (newScan != null) {
@@ -648,7 +648,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
                             estimatedSize += 
gps.getByteCounts().get(guideIndex);
                         }
                         scans = addNewScan(parallelScans, scans, newScan, 
currentGuidePostBytes, false, regionLocation);
-                        currentKeyBytes = currentGuidePost.copyBytes();
+                        currentKeyBytes = currentGuidePostBytes;
                         currentGuidePost = PrefixByteCodec.decode(decoder, 
input);
                         currentGuidePostBytes = currentGuidePost.copyBytes();
                         guideIndex++;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/452c7999/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfoBuilder.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfoBuilder.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfoBuilder.java
index 10d59ee..435f30a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfoBuilder.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfoBuilder.java
@@ -19,7 +19,7 @@ package org.apache.phoenix.schema.stats;
 
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.util.LinkedList;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
@@ -48,8 +48,8 @@ public class GuidePostsInfoBuilder {
     private int maxLength;
     private DataOutputStream output;
     private TrustedByteArrayOutputStream stream;
-    private List<Long> rowCounts = new LinkedList<Long>();
-    private List<Long> byteCounts = new LinkedList<Long>();
+    private List<Long> rowCounts = new ArrayList<Long>();
+    private List<Long> byteCounts = new ArrayList<Long>();
 
     public List<Long> getRowCounts() {
         return rowCounts;

Reply via email to