column placeholder for query_response_time_histogram

This commit is contained in:
AntiTopQuark
2024-05-06 05:40:14 +00:00
committed by ob-robot
parent 294b77d690
commit d0b7ba275c
8 changed files with 53 additions and 21 deletions

View File

@ -183,6 +183,12 @@ int ObInfoSchemaQueryResponseTimeTable::process_row_data(ObNewRow *&row, ObObj*
cells[cell_idx].set_int(time_collector_->total(utility_iter_));
break;
}
case SQL_TYPE: {
// unused
cells[cell_idx].set_varchar("");
cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
break;
}
default: {
ret = OB_ERR_UNEXPECTED;
SERVER_LOG(WARN, "invalid column id", K(ret), K(cell_idx), K(output_column_ids_), K(col_id));

View File

@ -59,7 +59,8 @@ private:
SVR_PORT,
QUERY_RESPPONSE_TIME,
COUNT,
TOTAL
TOTAL,
SQL_TYPE
};
common::ObAddr* addr_;
common::ObString ipstr_;

View File

@ -7763,7 +7763,7 @@ int ObInnerTableSchema::all_virtual_query_response_time_schema(ObTableSchema &ta
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
14, //column_precision
20, //column_precision
0, //column_scale
false, //is_nullable
false, //is_autoincrement
@ -7782,7 +7782,7 @@ int ObInnerTableSchema::all_virtual_query_response_time_schema(ObTableSchema &ta
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
14, //column_precision
20, //column_precision
0, //column_scale
false, //is_nullable
false, //is_autoincrement
@ -7801,13 +7801,32 @@ int ObInnerTableSchema::all_virtual_query_response_time_schema(ObTableSchema &ta
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
14, //column_precision
20, //column_precision
0, //column_scale
false, //is_nullable
false, //is_autoincrement
total_default,
total_default); //default_value
}
if (OB_SUCC(ret)) {
ObObj sql_type_default;
sql_type_default.set_varchar(ObString::make_string(""));
ADD_COLUMN_SCHEMA_T("sql_type", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObVarcharType, //column_type
CS_TYPE_INVALID, //column_collation_type
128, //column_length
-1, //column_precision
-1, //column_scale
false, //is_nullable
false, //is_autoincrement
sql_type_default,
sql_type_default); //default_value
}
if (OB_SUCC(ret)) {
table_schema.get_part_option().set_part_num(1);
table_schema.set_part_level(PARTITION_LEVEL_ONE);

View File

@ -12723,9 +12723,10 @@ def_table_schema(
('tenant_id', 'int', 'false'),
('svr_ip', 'varchar:MAX_IP_ADDR_LENGTH', 'false'),
('svr_port', 'int'),
('response_time', 'bigint:14', 'false', '0'),
('count', 'bigint:14', 'false', '0'),
('total', 'bigint:14', 'false', '0')
('response_time', 'bigint', 'false', '0'),
('count', 'bigint', 'false', '0'),
('total', 'bigint', 'false', '0'),
('sql_type', 'varchar:128', 'false', '')
],
partition_columns=['svr_ip', 'svr_port'],
vtable_route_policy = 'distributed',
@ -14795,6 +14796,7 @@ def_table_schema(**no_direct_access(gen_oracle_mapping_virtual_table_def('15451'
# 15454: __all_virtual_storage_io_usage
# 15455: __all_zone_storage
def_table_schema(**no_direct_access(gen_oracle_mapping_virtual_table_def('15456', all_def_keywords['__all_virtual_nic_info'])))
# 15457: __all_virtual_query_response_time
#
# 余留位置(此行之前占位)
# 本区域定义的Oracle表名比较复杂,一般都采用gen_xxx_table_def()方式定义,占位建议采用基表表名占位
@ -34140,7 +34142,8 @@ def_table_schema(
FROM oceanbase.__all_virtual_nic_info
""".replace("\n", " ")
)
# 21587: GV$OB_QUERY_RESPONSE_TIME_HISTOGRAM
# 21588: V$OB_QUERY_RESPONSE_TIME_HISTOGRAM
#
# 余留位置(此行之前占位)
@ -61666,7 +61669,8 @@ def_table_schema(
WHERE SVR_IP = host_ip() AND SVR_PORT = rpc_port()
""".replace("\n", " ")
)
# 28232: GV$OB_QUERY_RESPONSE_TIME_HISTOGRAM
# 23233: V$OB_QUERY_RESPONSE_TIME_HISTOGRAM
#
# 余留位置(此行之前占位)
# 本区域占位建议:采用真实视图名进行占位

View File

@ -4075,9 +4075,9 @@ cnt
1
desc information_schema.QUERY_RESPONSE_TIME;
Field Type Null Key Default Extra
RESPONSE_TIME bigint(14) NO
COUNT bigint(14) NO
TOTAL bigint(14) NO
RESPONSE_TIME bigint(20) NO
COUNT bigint(20) NO
TOTAL bigint(20) NO
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.QUERY_RESPONSE_TIME limit 1);
cnt
1

View File

@ -5637,9 +5637,9 @@ cnt
1
desc information_schema.QUERY_RESPONSE_TIME;
Field Type Null Key Default Extra
RESPONSE_TIME bigint(14) NO
COUNT bigint(14) NO
TOTAL bigint(14) NO
RESPONSE_TIME bigint(20) NO
COUNT bigint(20) NO
TOTAL bigint(20) NO
select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.QUERY_RESPONSE_TIME limit 1);
cnt
1

View File

@ -3393,9 +3393,10 @@ Field Type Null Key Default Extra
tenant_id bigint(20) NO NULL
svr_ip varchar(46) NO NULL
svr_port bigint(20) NO NULL
response_time bigint(14) NO 0
count bigint(14) NO 0
total bigint(14) NO 0
response_time bigint(20) NO 0
count bigint(20) NO 0
total bigint(20) NO 0
sql_type varchar(128) NO
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_query_response_time;
IF(count(*) >= 0, 1, 0)
1

View File

@ -7213,9 +7213,10 @@ Field Type Null Key Default Extra
tenant_id bigint(20) NO NULL
svr_ip varchar(46) NO NULL
svr_port bigint(20) NO NULL
response_time bigint(14) NO 0
count bigint(14) NO 0
total bigint(14) NO 0
response_time bigint(20) NO 0
count bigint(20) NO 0
total bigint(20) NO 0
sql_type varchar(128) NO
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_query_response_time;
IF(count(*) >= 0, 1, 0)
1