Reset sstable in store row iterator reuse

This commit is contained in:
DengzhiLiu
2023-11-07 02:09:34 +00:00
committed by ob-robot
parent e52ad9bb5f
commit 766bfcf984
7 changed files with 12 additions and 2 deletions

View File

@ -1680,7 +1680,7 @@ TEMP_DEF_BOOL(v4.3, enable_table_with_cg, OB_TENANT_PARAMETER, "False",
TEMP_DEF_INT(v4.3, encoding_test_seed, OB_CLUSTER_PARAMETER, "0", "[0,)" TEMP_DEF_INT(v4.3, encoding_test_seed, OB_CLUSTER_PARAMETER, "0", "[0,)"
"The seed is used to test encoding algorithm. The default is 0, indicating that it is not test, the production environment must keep the default value", "The seed is used to test encoding algorithm. The default is 0, indicating that it is not test, the production environment must keep the default value",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
TEMP_DEF_BOOL(v4.3, enable_table_without_all_cg, OB_TENANT_PARAMETER, "False", TEMP_DEF_BOOL(v4.3, enable_table_without_all_cg, OB_TENANT_PARAMETER, "True",
"enables creating table without all column_group. The default value is False.", "enables creating table without all column_group. The default value is False.",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_enable_prefetch_limiting, OB_TENANT_PARAMETER, "False", DEF_BOOL(_enable_prefetch_limiting, OB_TENANT_PARAMETER, "False",

View File

@ -43,6 +43,7 @@ void ObSSTableRowGetter::reuse()
ObStoreRowIterator::reuse(); ObStoreRowIterator::reuse();
is_opened_ = false; is_opened_ = false;
has_fetched_ = false; has_fetched_ = false;
sstable_ = nullptr;
prefetcher_.reuse(); prefetcher_.reuse();
read_handle_.reset(); read_handle_.reset();
} }

View File

@ -36,6 +36,7 @@ void ObSSTableRowMultiGetter::reuse()
{ {
ObStoreRowIterator::reuse(); ObStoreRowIterator::reuse();
is_opened_ = false; is_opened_ = false;
sstable_ = nullptr;
prefetcher_.reuse(); prefetcher_.reuse();
} }

View File

@ -49,6 +49,7 @@ void ObSSTableRowScanner<PrefetchType>::reuse()
ObStoreRowIterator::reuse(); ObStoreRowIterator::reuse();
is_opened_ = false; is_opened_ = false;
cur_range_idx_ = -1; cur_range_idx_ = -1;
sstable_ = nullptr;
if (nullptr != micro_scanner_) { if (nullptr != micro_scanner_) {
micro_scanner_->reuse(); micro_scanner_->reuse();
} }

View File

@ -120,6 +120,8 @@ void ObCGScanner::reuse()
if (nullptr != micro_scanner_) { if (nullptr != micro_scanner_) {
micro_scanner_->reuse(); micro_scanner_->reuse();
} }
sstable_ = nullptr;
table_wrapper_.reset();
query_index_range_.reset(); query_index_range_.reset();
prefetcher_.reuse(); prefetcher_.reuse();
is_new_range_ = false; is_new_range_ = false;

View File

@ -39,6 +39,8 @@ void ObCGGetter::reset()
void ObCGGetter::reuse() void ObCGGetter::reuse()
{ {
is_inited_ = false; is_inited_ = false;
sstable_ = nullptr;
table_wrapper_.reset();
is_same_data_block_ = false; is_same_data_block_ = false;
prefetcher_.reuse(); prefetcher_.reuse();
} }
@ -85,8 +87,9 @@ int ObCGGetter::init(
} else { } else {
ObMicroBlockDataHandle &micro_handle = prefetcher_.get_last_data_handle(); ObMicroBlockDataHandle &micro_handle = prefetcher_.get_last_data_handle();
is_same_data_block_ = is_same_data_block_ =
micro_handle.in_block_state() && nullptr != sstable_ &&
sstable->get_key() == sstable_->get_key() && sstable->get_key() == sstable_->get_key() &&
micro_handle.in_block_state() &&
0 == read_handle_.index_block_info_.get_row_range().compare(idx_key.datums_[0].get_int()) && 0 == read_handle_.index_block_info_.get_row_range().compare(idx_key.datums_[0].get_int()) &&
micro_handle.match( micro_handle.match(
read_handle_.index_block_info_.get_macro_id(), read_handle_.index_block_info_.get_macro_id(),
@ -190,6 +193,7 @@ void ObCGSSTableRowGetter::reuse()
{ {
is_inited_ = false; is_inited_ = false;
row_.reuse(); row_.reuse();
co_sstable_ = nullptr;
ObStoreRowIterator::reuse(); ObStoreRowIterator::reuse();
} }

View File

@ -187,6 +187,7 @@ void ObCOSSTableRowsFilter::reuse()
prepared_ = false; prepared_ = false;
subtree_filter_iter_to_locate_ = 0; subtree_filter_iter_to_locate_ = 0;
subtree_filter_iter_to_filter_ = 0; subtree_filter_iter_to_filter_ = 0;
co_sstable_ = nullptr;
} }
int ObCOSSTableRowsFilter::apply(const ObCSRange &range) int ObCOSSTableRowsFilter::apply(const ObCSRange &range)