[FEAT MERGE] impl vectorization 2.0

Co-authored-by: Naynahs <cfzy002@126.com>
Co-authored-by: hwx65 <1780011298@qq.com>
Co-authored-by: oceanoverflow <oceanoverflow@gmail.com>
This commit is contained in:
obdev
2023-12-22 03:43:19 +00:00
committed by ob-robot
parent 1178245448
commit b6773084c6
592 changed files with 358124 additions and 303288 deletions

View File

@ -46,6 +46,9 @@ int ObSqlMemMgrProcessor::init(
if (OB_ISNULL(exec_ctx)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to get exec ctx", K(ret));
} else if (OB_ISNULL(allocator)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to get allocator", K(ret));
} else if (OB_FAIL(profile_.set_exec_info(*exec_ctx))) {
LOG_WARN("failed to set exec info", K(ret));
} else if (OB_FAIL(alloc_dir_id(dir_id_))) {
@ -103,6 +106,13 @@ int ObSqlMemMgrProcessor::init(
if (!profile_.get_auto_policy()) {
profile_.set_max_bound(max_mem_size);
}
if (OB_SUCC(ret) && nullptr == dummy_alloc_) {
dummy_alloc_ = allocator;
if (OB_ISNULL(dummy_ptr_ = static_cast<char *> (dummy_alloc_->alloc(sizeof(char))))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to alloc dummy memory", K(ret));
}
}
// 如果开启了sql memory manager,但由于预估数据量比较少,不需要注册到manager里,这里限制为MAX_SQL_MEM_SIZE
origin_max_mem_size_ = max_mem_size;
default_available_mem_size_ = tmp_enable_auto_mem_mgr ? MAX_SQL_MEM_SIZE : max_mem_size;
@ -296,6 +306,11 @@ void ObSqlMemMgrProcessor::unregister_profile()
destroy();
LOG_DEBUG("trace unregister work area profile", K(profile_));
}
if (OB_NOT_NULL(dummy_ptr_)) {
dummy_alloc_->free(dummy_ptr_);
dummy_ptr_ = nullptr;
dummy_alloc_ = nullptr;
}
}
int ObSqlMemMgrProcessor::alloc_dir_id(int64_t &dir_id)