[FEAT MERGE] Support index usage monitoring

This commit is contained in:
obdev
2024-02-07 16:12:34 +00:00
committed by ob-robot
parent f7a91cb0b1
commit 112b0dfbd4
35 changed files with 3119 additions and 25 deletions

View File

@ -557,6 +557,7 @@ public:
static int all_import_table_task_schema(share::schema::ObTableSchema &table_schema);
static int all_import_table_task_history_schema(share::schema::ObTableSchema &table_schema);
static int all_aux_stat_schema(share::schema::ObTableSchema &table_schema);
static int all_index_usage_info_schema(share::schema::ObTableSchema &table_schema);
static int tenant_virtual_all_table_schema(share::schema::ObTableSchema &table_schema);
static int tenant_virtual_table_column_schema(share::schema::ObTableSchema &table_schema);
static int tenant_virtual_table_index_schema(share::schema::ObTableSchema &table_schema);
@ -961,6 +962,7 @@ public:
static int all_virtual_import_table_task_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_import_table_task_history_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_aux_stat_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_index_usage_info_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_audit_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_plan_stat_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_plan_cache_plan_explain_ora_schema(share::schema::ObTableSchema &table_schema);
@ -1210,6 +1212,7 @@ public:
static int all_virtual_import_table_task_history_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_ls_info_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_aux_stat_real_agent_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_index_usage_info_real_agent_ora_schema(share::schema::ObTableSchema &table_schema);
static int gv_ob_plan_cache_stat_schema(share::schema::ObTableSchema &table_schema);
static int gv_ob_plan_cache_plan_stat_schema(share::schema::ObTableSchema &table_schema);
static int schemata_schema(share::schema::ObTableSchema &table_schema);
@ -1579,6 +1582,8 @@ public:
static int v_ob_tenant_runtime_info_schema(share::schema::ObTableSchema &table_schema);
static int dba_ob_aux_statistics_schema(share::schema::ObTableSchema &table_schema);
static int cdb_ob_aux_statistics_schema(share::schema::ObTableSchema &table_schema);
static int dba_index_usage_schema(share::schema::ObTableSchema &table_schema);
static int cdb_index_usage_schema(share::schema::ObTableSchema &table_schema);
static int dba_synonyms_schema(share::schema::ObTableSchema &table_schema);
static int dba_objects_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_objects_schema(share::schema::ObTableSchema &table_schema);
@ -2002,6 +2007,7 @@ public:
static int v_ob_ls_log_restore_status_ora_schema(share::schema::ObTableSchema &table_schema);
static int gv_ob_flt_trace_config_ora_schema(share::schema::ObTableSchema &table_schema);
static int dba_ob_aux_statistics_ora_schema(share::schema::ObTableSchema &table_schema);
static int dba_index_usage_ora_schema(share::schema::ObTableSchema &table_schema);
static int all_table_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
static int all_column_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
static int all_ddl_operation_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
@ -2267,6 +2273,7 @@ public:
static int all_import_table_task_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
static int all_import_table_task_history_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
static int all_aux_stat_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
static int all_index_usage_info_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema);
static int all_table_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_column_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_ddl_operation_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
@ -2532,6 +2539,7 @@ public:
static int all_import_table_task_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_import_table_task_history_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_aux_stat_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_index_usage_info_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_ash_all_virtual_ash_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_plan_monitor_all_virtual_sql_plan_monitor_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_audit_all_virtual_sql_audit_i1_schema(share::schema::ObTableSchema &table_schema);
@ -3001,6 +3009,7 @@ const schema_create_func sys_table_schema_creators [] = {
ObInnerTableSchema::all_import_table_task_schema,
ObInnerTableSchema::all_import_table_task_history_schema,
ObInnerTableSchema::all_aux_stat_schema,
ObInnerTableSchema::all_index_usage_info_schema,
NULL,};
const schema_create_func virtual_table_schema_creators [] = {
@ -3408,6 +3417,7 @@ const schema_create_func virtual_table_schema_creators [] = {
ObInnerTableSchema::all_virtual_import_table_task_schema,
ObInnerTableSchema::all_virtual_import_table_task_history_schema,
ObInnerTableSchema::all_virtual_aux_stat_schema,
ObInnerTableSchema::all_virtual_index_usage_info_schema,
ObInnerTableSchema::all_virtual_ash_all_virtual_ash_i1_schema,
ObInnerTableSchema::all_virtual_sql_plan_monitor_all_virtual_sql_plan_monitor_i1_schema,
ObInnerTableSchema::all_virtual_sql_audit_all_virtual_sql_audit_i1_schema,
@ -3667,6 +3677,7 @@ const schema_create_func virtual_table_schema_creators [] = {
ObInnerTableSchema::all_virtual_import_table_task_history_ora_schema,
ObInnerTableSchema::all_virtual_ls_info_ora_schema,
ObInnerTableSchema::all_virtual_aux_stat_real_agent_ora_schema,
ObInnerTableSchema::all_virtual_index_usage_info_real_agent_ora_schema,
ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_data_table_id_real_agent_schema,
ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_db_tb_name_real_agent_schema,
ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_tb_name_real_agent_schema,
@ -4120,6 +4131,8 @@ const schema_create_func sys_view_schema_creators [] = {
ObInnerTableSchema::v_ob_tenant_runtime_info_schema,
ObInnerTableSchema::dba_ob_aux_statistics_schema,
ObInnerTableSchema::cdb_ob_aux_statistics_schema,
ObInnerTableSchema::dba_index_usage_schema,
ObInnerTableSchema::cdb_index_usage_schema,
ObInnerTableSchema::dba_synonyms_schema,
ObInnerTableSchema::dba_objects_ora_schema,
ObInnerTableSchema::all_objects_schema,
@ -4543,6 +4556,7 @@ const schema_create_func sys_view_schema_creators [] = {
ObInnerTableSchema::v_ob_ls_log_restore_status_ora_schema,
ObInnerTableSchema::gv_ob_flt_trace_config_ora_schema,
ObInnerTableSchema::dba_ob_aux_statistics_ora_schema,
ObInnerTableSchema::dba_index_usage_ora_schema,
NULL,};
const schema_create_func core_index_table_schema_creators [] = {
@ -4901,6 +4915,7 @@ const uint64_t tenant_space_tables [] = {
OB_ALL_IMPORT_TABLE_TASK_TID,
OB_ALL_IMPORT_TABLE_TASK_HISTORY_TID,
OB_ALL_AUX_STAT_TID,
OB_ALL_INDEX_USAGE_INFO_TID,
OB_TENANT_VIRTUAL_ALL_TABLE_TID,
OB_TENANT_VIRTUAL_TABLE_COLUMN_TID,
OB_TENANT_VIRTUAL_TABLE_INDEX_TID,
@ -5357,6 +5372,7 @@ const uint64_t tenant_space_tables [] = {
OB_ALL_VIRTUAL_IMPORT_TABLE_TASK_HISTORY_ORA_TID,
OB_ALL_VIRTUAL_LS_INFO_ORA_TID,
OB_ALL_VIRTUAL_AUX_STAT_REAL_AGENT_ORA_TID,
OB_ALL_VIRTUAL_INDEX_USAGE_INFO_REAL_AGENT_ORA_TID,
OB_GV_OB_PLAN_CACHE_STAT_TID,
OB_GV_OB_PLAN_CACHE_PLAN_STAT_TID,
OB_SCHEMATA_TID,
@ -5621,6 +5637,7 @@ const uint64_t tenant_space_tables [] = {
OB_DBA_OB_IMPORT_TABLE_TASKS_TID,
OB_DBA_OB_IMPORT_TABLE_TASK_HISTORY_TID,
OB_DBA_OB_AUX_STATISTICS_TID,
OB_DBA_INDEX_USAGE_TID,
OB_DBA_SYNONYMS_TID,
OB_DBA_OBJECTS_ORA_TID,
OB_ALL_OBJECTS_TID,
@ -6044,6 +6061,7 @@ const uint64_t tenant_space_tables [] = {
OB_V_OB_LS_LOG_RESTORE_STATUS_ORA_TID,
OB_GV_OB_FLT_TRACE_CONFIG_ORA_TID,
OB_DBA_OB_AUX_STATISTICS_ORA_TID,
OB_DBA_INDEX_USAGE_ORA_TID,
OB_ALL_TABLE_IDX_DATA_TABLE_ID_TID,
OB_ALL_TABLE_IDX_DB_TB_NAME_TID,
OB_ALL_TABLE_IDX_TB_NAME_TID,
@ -6452,6 +6470,7 @@ const uint64_t tenant_space_tables [] = {
OB_ALL_IMPORT_TABLE_TASK_AUX_LOB_META_TID,
OB_ALL_IMPORT_TABLE_TASK_HISTORY_AUX_LOB_META_TID,
OB_ALL_AUX_STAT_AUX_LOB_META_TID,
OB_ALL_INDEX_USAGE_INFO_AUX_LOB_META_TID,
OB_ALL_TABLE_AUX_LOB_PIECE_TID,
OB_ALL_COLUMN_AUX_LOB_PIECE_TID,
OB_ALL_DDL_OPERATION_AUX_LOB_PIECE_TID,
@ -6695,7 +6714,8 @@ const uint64_t tenant_space_tables [] = {
OB_ALL_IMPORT_TABLE_JOB_HISTORY_AUX_LOB_PIECE_TID,
OB_ALL_IMPORT_TABLE_TASK_AUX_LOB_PIECE_TID,
OB_ALL_IMPORT_TABLE_TASK_HISTORY_AUX_LOB_PIECE_TID,
OB_ALL_AUX_STAT_AUX_LOB_PIECE_TID, };
OB_ALL_AUX_STAT_AUX_LOB_PIECE_TID,
OB_ALL_INDEX_USAGE_INFO_AUX_LOB_PIECE_TID, };
const uint64_t all_ora_mapping_virtual_table_org_tables [] = {
OB_ALL_VIRTUAL_SQL_AUDIT_TID,
@ -7232,6 +7252,7 @@ const char* const tenant_space_table_names [] = {
OB_ALL_IMPORT_TABLE_TASK_TNAME,
OB_ALL_IMPORT_TABLE_TASK_HISTORY_TNAME,
OB_ALL_AUX_STAT_TNAME,
OB_ALL_INDEX_USAGE_INFO_TNAME,
OB_TENANT_VIRTUAL_ALL_TABLE_TNAME,
OB_TENANT_VIRTUAL_TABLE_COLUMN_TNAME,
OB_TENANT_VIRTUAL_TABLE_INDEX_TNAME,
@ -7688,6 +7709,7 @@ const char* const tenant_space_table_names [] = {
OB_ALL_VIRTUAL_IMPORT_TABLE_TASK_HISTORY_ORA_TNAME,
OB_ALL_VIRTUAL_LS_INFO_ORA_TNAME,
OB_ALL_VIRTUAL_AUX_STAT_REAL_AGENT_ORA_TNAME,
OB_ALL_VIRTUAL_INDEX_USAGE_INFO_REAL_AGENT_ORA_TNAME,
OB_GV_OB_PLAN_CACHE_STAT_TNAME,
OB_GV_OB_PLAN_CACHE_PLAN_STAT_TNAME,
OB_SCHEMATA_TNAME,
@ -7952,6 +7974,7 @@ const char* const tenant_space_table_names [] = {
OB_DBA_OB_IMPORT_TABLE_TASKS_TNAME,
OB_DBA_OB_IMPORT_TABLE_TASK_HISTORY_TNAME,
OB_DBA_OB_AUX_STATISTICS_TNAME,
OB_DBA_INDEX_USAGE_TNAME,
OB_DBA_SYNONYMS_TNAME,
OB_DBA_OBJECTS_ORA_TNAME,
OB_ALL_OBJECTS_TNAME,
@ -8375,6 +8398,7 @@ const char* const tenant_space_table_names [] = {
OB_V_OB_LS_LOG_RESTORE_STATUS_ORA_TNAME,
OB_GV_OB_FLT_TRACE_CONFIG_ORA_TNAME,
OB_DBA_OB_AUX_STATISTICS_ORA_TNAME,
OB_DBA_INDEX_USAGE_ORA_TNAME,
OB_ALL_TABLE_IDX_DATA_TABLE_ID_TNAME,
OB_ALL_TABLE_IDX_DB_TB_NAME_TNAME,
OB_ALL_TABLE_IDX_TB_NAME_TNAME,
@ -8783,6 +8807,7 @@ const char* const tenant_space_table_names [] = {
OB_ALL_IMPORT_TABLE_TASK_AUX_LOB_META_TNAME,
OB_ALL_IMPORT_TABLE_TASK_HISTORY_AUX_LOB_META_TNAME,
OB_ALL_AUX_STAT_AUX_LOB_META_TNAME,
OB_ALL_INDEX_USAGE_INFO_AUX_LOB_META_TNAME,
OB_ALL_TABLE_AUX_LOB_PIECE_TNAME,
OB_ALL_COLUMN_AUX_LOB_PIECE_TNAME,
OB_ALL_DDL_OPERATION_AUX_LOB_PIECE_TNAME,
@ -9026,7 +9051,8 @@ const char* const tenant_space_table_names [] = {
OB_ALL_IMPORT_TABLE_JOB_HISTORY_AUX_LOB_PIECE_TNAME,
OB_ALL_IMPORT_TABLE_TASK_AUX_LOB_PIECE_TNAME,
OB_ALL_IMPORT_TABLE_TASK_HISTORY_AUX_LOB_PIECE_TNAME,
OB_ALL_AUX_STAT_AUX_LOB_PIECE_TNAME, };
OB_ALL_AUX_STAT_AUX_LOB_PIECE_TNAME,
OB_ALL_INDEX_USAGE_INFO_AUX_LOB_PIECE_TNAME, };
const uint64_t only_rs_vtables [] = {
OB_ALL_VIRTUAL_CORE_META_TABLE_TID,
@ -9356,7 +9382,8 @@ const uint64_t restrict_access_virtual_tables[] = {
OB_ALL_VIRTUAL_IMPORT_TABLE_JOB_ORA_TID,
OB_ALL_VIRTUAL_IMPORT_TABLE_JOB_HISTORY_ORA_TID,
OB_ALL_VIRTUAL_IMPORT_TABLE_TASK_ORA_TID,
OB_ALL_VIRTUAL_IMPORT_TABLE_TASK_HISTORY_ORA_TID };
OB_ALL_VIRTUAL_IMPORT_TABLE_TASK_HISTORY_ORA_TID,
OB_ALL_VIRTUAL_INDEX_USAGE_INFO_REAL_AGENT_ORA_TID };
static inline bool is_restrict_access_virtual_table(const uint64_t tid)
@ -11623,6 +11650,14 @@ LOBMapping const lob_aux_table_mappings [] = {
ObInnerTableSchema::all_aux_stat_aux_lob_piece_schema
},
{
OB_ALL_INDEX_USAGE_INFO_TID,
OB_ALL_INDEX_USAGE_INFO_AUX_LOB_META_TID,
OB_ALL_INDEX_USAGE_INFO_AUX_LOB_PIECE_TID,
ObInnerTableSchema::all_index_usage_info_aux_lob_meta_schema,
ObInnerTableSchema::all_index_usage_info_aux_lob_piece_schema
},
};
static inline bool get_sys_table_lob_aux_table_id(const uint64_t tid, uint64_t& meta_tid, uint64_t& piece_tid)
@ -11660,12 +11695,12 @@ static inline int get_sys_table_lob_aux_schema(const uint64_t tid,
}
const int64_t OB_CORE_TABLE_COUNT = 4;
const int64_t OB_SYS_TABLE_COUNT = 262;
const int64_t OB_VIRTUAL_TABLE_COUNT = 744;
const int64_t OB_SYS_VIEW_COUNT = 792;
const int64_t OB_SYS_TENANT_TABLE_COUNT = 1803;
const int64_t OB_SYS_TABLE_COUNT = 263;
const int64_t OB_VIRTUAL_TABLE_COUNT = 746;
const int64_t OB_SYS_VIEW_COUNT = 795;
const int64_t OB_SYS_TENANT_TABLE_COUNT = 1809;
const int64_t OB_CORE_SCHEMA_VERSION = 1;
const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 1806;
const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 1812;
} // end namespace share
} // end namespace oceanbase