[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

@ -14,6 +14,7 @@
#include "ob_table_scan_executor.h"
#include "ob_table_context.h"
#include "sql/das/ob_das_utils.h"
#include "share/index_usage/ob_index_usage_info_mgr.h"
namespace oceanbase
{
@ -276,6 +277,15 @@ int ObTableApiScanExecutor::close()
}
}
if (OB_SUCC(ret)) {
oceanbase::share::ObIndexUsageInfoMgr *mgr = MTL(oceanbase::share::ObIndexUsageInfoMgr *);
if (tb_ctx_.get_table_id() == tb_ctx_.get_ref_table_id()) {
// skip // use primary key, do nothing
} else if (OB_NOT_NULL(mgr)) {
mgr->update(tb_ctx_.get_tenant_id(), tb_ctx_.get_index_table_id());
}
}
return ret;
}