From a4e5ccc7986c9d4e13a8986ba74298a249728b56 Mon Sep 17 00:00:00 2001 From: Lars Date: Thu, 16 Jul 2020 13:17:05 -0700 Subject: [PATCH] HBASE-24742 Improve performance of SKIP vs SEEK logic. --- .../org/apache/hadoop/hbase/regionserver/StoreScanner.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java index b7c6b1c8676..8c48b124645 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java @@ -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). - 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;