[FEAT MERGE] Support index usage monitoring

Co-authored-by: Phoeniwx <phoeniwx@outlook.com>
Co-authored-by: jiangxianfu <steven_jiangxf@hotmail.com>
This commit is contained in:
JLY2015
2023-12-11 11:17:17 +00:00
committed by ant-ob-hengtang
parent f2e44cf4df
commit 663ba5569a
35 changed files with 3119 additions and 25 deletions

View File

@ -32,6 +32,7 @@
#include "share/external_table/ob_external_table_file_mgr.h"
#include "share/external_table/ob_external_table_utils.h"
#include "lib/container/ob_array_wrap.h"
#include "share/index_usage/ob_index_usage_info_mgr.h"
namespace oceanbase
{
@ -1362,6 +1363,19 @@ int ObTableScanOp::inner_close()
if (OB_SUCC(ret)) {
fill_sql_plan_monitor_info();
}
if (OB_SUCC(ret) && MY_SPEC.should_scan_index()) {
ObSQLSessionInfo *session = GET_MY_SESSION(ctx_);
if (OB_NOT_NULL(session)) {
uint64_t tenant_id = session->get_effective_tenant_id();
uint64_t index_id = MY_CTDEF.scan_ctdef_.ref_table_id_;
oceanbase::share::ObIndexUsageInfoMgr* mgr = MTL(oceanbase::share::ObIndexUsageInfoMgr*);
if (OB_NOT_NULL(mgr)) {
mgr->update(tenant_id, index_id);
}
}
}
if (OB_SUCC(ret)) {
iter_end_ = false;
need_init_before_get_row_ = true;