Skip to content

Commit

Permalink
HBASE-24742 Improve performance of SKIP vs SEEK logic.
Browse files Browse the repository at this point in the history
Author: Lars Hofhansl
Reason: Bug
Ref: CDPD-15964

Change-Id: I120e1aaa95f6a170a01953af1a68ea6fccba4405
(cherry picked from commit 9c51adb)
  • Loading branch information
lhofhansl authored and robertkerek-cldr committed Sep 2, 2020
1 parent 158637e commit 846a0b0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ private StoreScanner(HStore store, Scan scan, ScanInfo scanInfo,
// the seek operation. However, we also look the row-column Bloom filter
// for multi-row (non-"get") scans because this is not done in
// StoreFile.passesBloomFilter(Scan, SortedSet<byte[]>).
this.useRowColBloom = numColumns > 1 || (!get && numColumns == 1);
this.useRowColBloom = numColumns > 1 || (!get && numColumns == 1)
&& (store == null || store.getColumnFamilyDescriptor().getBloomFilterType() == BloomType.ROWCOL);
this.maxRowSize = scanInfo.getTableMaxRowSize();
if (get) {
this.readType = Scan.ReadType.PREAD;
Expand Down Expand Up @@ -865,7 +866,7 @@ protected boolean trySkipToNextColumn(Cell cell) throws IOException {
// We need this check because it may happen that the new scanner that we get
// during heap.next() is requiring reseek due of fake KV previously generated for
// ROWCOL bloom filter optimization. See HBASE-19863 for more details
if (nextCell != null && matcher.compareKeyForNextColumn(nextCell, cell) < 0) {
if (useRowColBloom && nextCell != null && matcher.compareKeyForNextColumn(nextCell, cell) < 0) {
return false;
}
return true;
Expand Down

0 comments on commit 846a0b0

Please sign in to comment.