[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:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user