[ 
https://issues.apache.org/jira/browse/HBASE-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906044#action_12906044
 ] 

ryan rawson commented on HBASE-2450:
------------------------------------

ran a profiler-based timing test and with this patch things seem to be faster:

diff --git 
a/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java 
b/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
index 286cb64..b24b28f 100644
--- a/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
+++ b/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java
@@ -77,17 +77,22 @@ public class ScanQueryMatcher {
     this.rowComparator = rowComparator;
     this.deletes =  new ScanDeleteTracker();
     this.stopRow = scan.getStopRow();
-    this.startKey = KeyValue.createFirstOnRow(scan.getStartRow());
     this.filter = scan.getFilter();
 
     // Single branch to deal with two types of reads (columns vs all in family)
     if (columns == null || columns.size() == 0) {
       // use a specialized scan for wildcard column tracker.
       this.columns = new ScanWildcardColumnTracker(maxVersions);
+      this.startKey = KeyValue.createFirstOnRow(scan.getStartRow());
     } else {
       // We can share the ExplicitColumnTracker, diff is we reset
       // between rows, not between storefiles.
-      this.columns = new ExplicitColumnTracker(columns,maxVersions);
+      this.columns = new ExplicitColumnTracker(columns, maxVersions);
+      final ColumnCount hint = this.columns.getColumnHint();
+      this.startKey = KeyValue.createFirstOnRow(scan.getStartRow(),
+          0, scan.getStartRow().length,
+          family, 0, family.length,
+          hint.getBuffer(), hint.getOffset(), hint.getLength());
     }
   }

> For single row reads of specific columns, seek to the first column in HFiles 
> rather than start of row
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-2450
>                 URL: https://issues.apache.org/jira/browse/HBASE-2450
>             Project: HBase
>          Issue Type: Improvement
>          Components: io, regionserver
>            Reporter: Jonathan Gray
>            Assignee: Pranav Khaitan
>             Fix For: 0.90.0
>
>
> Currently we will always seek to the start of a row.  If we are getting 
> specific columns, we should seek to the first column in that row.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to