Index: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java (revision 1525983) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java (working copy) @@ -1461,8 +1461,10 @@ StoreFile sf = sfIterator.next(); sfIterator.remove(); // Remove sf from iterator. boolean haveNewCandidate = rowAtOrBeforeFromStoreFile(sf, state); + KeyValue keyv = state.getCandidate(); + // we have an optimization here which stops the search if we find exact match. + if (keyv != null && keyv.matchingRow(row)) return state.getCandidate(); if (haveNewCandidate) { - // TODO: we may have an optimization here which stops the search if we find exact match. sfIterator = this.storeEngine.getStoreFileManager().updateCandidateFilesForRowKeyBefore( sfIterator, state.getTargetKey(), state.getCandidate()); }