diff --git a/src/storage/access/ob_multiple_merge.cpp b/src/storage/access/ob_multiple_merge.cpp index d83f38e0c6..2180811a93 100644 --- a/src/storage/access/ob_multiple_merge.cpp +++ b/src/storage/access/ob_multiple_merge.cpp @@ -1504,7 +1504,7 @@ int ObMultipleMerge::set_base_version() const { int ret = OB_SUCCESS; // When the major table is currently being processed, the snapshot version is taken and placed // in the current context for base version to filter unnecessary rows in the mini or minor sstable - if (OB_LIKELY(tables_.count() > 0)) { + if (is_scan() && tables_.count() > 0) { ObITable *table = nullptr; if (OB_FAIL(tables_.at(0, table))) { STORAGE_LOG(WARN, "Fail to get the first store", K(ret)); diff --git a/src/storage/access/ob_store_row_iterator.h b/src/storage/access/ob_store_row_iterator.h index 1e150b09ae..c482cc9d97 100644 --- a/src/storage/access/ob_store_row_iterator.h +++ b/src/storage/access/ob_store_row_iterator.h @@ -200,6 +200,7 @@ public: VIRTUAL_TO_STRING_KV(K_(type)); public: ObQRIterType get_type() const { return type_; } + bool is_scan() const { return type_ == T_SINGLE_SCAN || type_ == T_MULTI_SCAN; } protected: ObQRIterType type_;