HBASE-24742 Improve performance of SKIP vs SEEK logic.

This commit is contained in:
Lars 2020-07-16 13:17:05 -07:00
parent 2505c7760d
commit a4e5ccc798
1 changed files with 3 additions and 2 deletions

View File

@ -183,7 +183,8 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
// 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;
@ -916,7 +917,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
// 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;