diff --git a/src/sql/engine/basic/ob_chunk_datum_store.h b/src/sql/engine/basic/ob_chunk_datum_store.h index faafb87122..151c5ca2ac 100644 --- a/src/sql/engine/basic/ob_chunk_datum_store.h +++ b/src/sql/engine/basic/ob_chunk_datum_store.h @@ -673,6 +673,7 @@ public: class IterationAge { public: + IterationAge() : age_(0) {} int64_t get(void) const { return age_; } void inc(void) { age_ += 1; } private: diff --git a/src/sql/engine/join/ob_hash_join_op.cpp b/src/sql/engine/join/ob_hash_join_op.cpp index 558ac28dfc..9aea7bb044 100644 --- a/src/sql/engine/join/ob_hash_join_op.cpp +++ b/src/sql/engine/join/ob_hash_join_op.cpp @@ -1250,8 +1250,8 @@ int ObHashJoinOp::build_hash_table_for_nest_loop(int64_t &num_left_rows) int64_t memory_bound = std::max(remain_data_memory_size_, hj_batch->get_chunk_row_store().get_max_blk_size()); const int64_t row_bound = hash_table.nbuckets_ / 2; - ObChunkDatumStore::IterationAge iter_age; - hj_batch->set_iteration_age(iter_age); + hj_batch->set_iteration_age(iter_age_); + iter_age_.inc(); while (OB_SUCC(ret)) { int64_t read_size = 0; if (OB_FAIL(hj_batch->get_next_batch(left_stored_rows, @@ -1740,8 +1740,8 @@ int ObHashJoinOp::build_hash_table_in_memory(int64_t &num_left_rows) // do nothing } else { PartHashJoinTable &hash_table = *cur_hash_table_; - ObChunkDatumStore::IterationAge iter_age; - hj_batch->set_iteration_age(iter_age); + hj_batch->set_iteration_age(iter_age_); + iter_age_.inc(); while (OB_SUCC(ret)) { int64_t read_size = 0; if (OB_FAIL(hj_batch->get_next_batch(left_stored_rows, diff --git a/src/sql/engine/join/ob_hash_join_op.h b/src/sql/engine/join/ob_hash_join_op.h index 4e28b708ee..5459727cd7 100644 --- a/src/sql/engine/join/ob_hash_join_op.h +++ b/src/sql/engine/join/ob_hash_join_op.h @@ -1269,6 +1269,7 @@ private: */ bool skip_left_null_; bool skip_right_null_; + ObChunkDatumStore::IterationAge iter_age_; }; inline int ObHashJoinOp::init_mem_context(uint64_t tenant_id)