Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.0 7a476eb49 -> ae3687972
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/ae368797 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ae368797 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ae368797 Branch: refs/heads/4.x-HBase-1.0 Commit: ae36879721722d0187ee7cd6cad9691f00638bf8 Parents: 7a476eb 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:42:29 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/ae368797/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/ae368797/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;