placeholder for ash columns.

This commit is contained in:
rolandqi 2024-04-26 09:15:58 +00:00 committed by ob-robot
parent 7b2d31f0ff
commit 6b7caed6ce
10 changed files with 362 additions and 2 deletions

View File

@ -341,6 +341,18 @@ int ObVirtualASH::convert_node_to_row(const ActiveSessionStat &node, ObNewRow *&
cells[cell_idx].set_null();
break;
}
case PLAN_HASH: {
cells[cell_idx].set_null();
break;
}
case THREAD_ID: {
cells[cell_idx].set_null();
break;
}
case STMT_TYPE: {
cells[cell_idx].set_null();
break;
}
default: {
ret = OB_ERR_UNEXPECTED;
SERVER_LOG(WARN, "invalid column id", K(column_id), K(cell_idx),

View File

@ -94,6 +94,9 @@ protected:
GROUP_ID,
TX_ID,
BLOCKING_SESSION_ID,
PLAN_HASH,
THREAD_ID,
STMT_TYPE,
};
DISALLOW_COPY_AND_ASSIGN(ObVirtualASH);
share::ObActiveSessHistList::Iterator iterator_;

View File

@ -1365,6 +1365,51 @@ int ObInnerTableSchema::all_virtual_ash_schema(ObTableSchema &table_schema)
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("PLAN_HASH", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("THREAD_ID", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("STMT_TYPE", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
table_schema.get_part_option().set_part_num(1);
table_schema.set_part_level(PARTITION_LEVEL_ONE);
@ -2350,7 +2395,58 @@ int ObInnerTableSchema::all_virtual_ash_all_virtual_ash_i1_schema(ObTableSchema
true);//is_storing_column
}
table_schema.set_max_used_column_id(column_id + 52);
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("PLAN_HASH", //column_name
column_id + 53, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true,//is_nullable
false,//is_autoincrement
false,//is_hidden
true);//is_storing_column
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("THREAD_ID", //column_name
column_id + 54, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true,//is_nullable
false,//is_autoincrement
false,//is_hidden
true);//is_storing_column
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("STMT_TYPE", //column_name
column_id + 55, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true,//is_nullable
false,//is_autoincrement
false,//is_hidden
true);//is_storing_column
}
table_schema.set_max_used_column_id(column_id + 55);
return ret;
}

View File

@ -7324,6 +7324,51 @@ int ObInnerTableSchema::all_virtual_wr_active_session_history_schema(ObTableSche
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("plan_hash", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("thread_id", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("stmt_type", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
table_schema.set_index_using_type(USING_BTREE);
table_schema.set_row_store_type(ENCODING_ROW_STORE);
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);

View File

@ -14122,6 +14122,51 @@ int ObInnerTableSchema::all_virtual_ash_ora_schema(ObTableSchema &table_schema)
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("PLAN_HASH", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("THREAD_ID", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("STMT_TYPE", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
table_schema.get_part_option().set_part_num(1);
table_schema.set_part_level(PARTITION_LEVEL_ONE);
@ -15078,7 +15123,58 @@ int ObInnerTableSchema::all_virtual_ash_ora_all_virtual_ash_i1_schema(ObTableSch
true);//is_storing_column
}
table_schema.set_max_used_column_id(column_id + 52);
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("PLAN_HASH", //column_name
column_id + 53, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true,//is_nullable
false,//is_autoincrement
false,//is_hidden
true);//is_storing_column
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("THREAD_ID", //column_name
column_id + 54, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true,//is_nullable
false,//is_autoincrement
false,//is_hidden
true);//is_storing_column
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("STMT_TYPE", //column_name
column_id + 55, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true,//is_nullable
false,//is_autoincrement
false,//is_hidden
true);//is_storing_column
}
table_schema.set_max_used_column_id(column_id + 55);
return ret;
}

View File

@ -11707,6 +11707,51 @@ int ObInnerTableSchema::all_virtual_wr_active_session_history_ora_schema(ObTable
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("PLAN_HASH", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("THREAD_ID", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("STMT_TYPE", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
true, //is_nullable
false); //is_autoincrement
}
table_schema.set_index_using_type(USING_BTREE);
table_schema.set_row_store_type(ENCODING_ROW_STORE);
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);

View File

@ -1358,6 +1358,51 @@ int ObInnerTableSchema::wr_active_session_history_schema(ObTableSchema &table_sc
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("plan_hash", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("thread_id", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("stmt_type", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObIntType, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(int64_t), //column_length
-1, //column_precision
-1, //column_scale
true, //is_nullable
false); //is_autoincrement
}
table_schema.set_index_using_type(USING_BTREE);
table_schema.set_row_store_type(ENCODING_ROW_STORE);
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);

View File

@ -5940,6 +5940,9 @@ def_table_schema(
('group_id', 'int', 'true'),
('tx_id', 'int', 'true'),
('blocking_session_id', 'int', 'true'),
('plan_hash', 'int', 'true'),
('thread_id', 'int', 'true'),
('stmt_type', 'int', 'true'),
],
)
@ -12459,6 +12462,9 @@ def_table_schema(
('GROUP_ID', 'int', 'true'),
('TX_ID', 'int', 'true'),
('BLOCKING_SESSION_ID', 'int', 'true'),
('PLAN_HASH', 'int', 'true'),
('THREAD_ID', 'int', 'true'),
('STMT_TYPE', 'int', 'true'),
],
partition_columns = ['SVR_IP', 'SVR_PORT'],
vtable_route_policy = 'distributed',

View File

@ -3120,6 +3120,9 @@ IN_FILTER_ROWS tinyint(4) NO 0
GROUP_ID bigint(20) YES NULL
TX_ID bigint(20) YES NULL
BLOCKING_SESSION_ID bigint(20) YES NULL
PLAN_HASH bigint(20) YES NULL
THREAD_ID bigint(20) YES NULL
STMT_TYPE bigint(20) YES NULL
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_ash;
IF(count(*) >= 0, 1, 0)
1
@ -3905,6 +3908,9 @@ event_id bigint(20) YES NULL
group_id bigint(20) YES NULL
tx_id bigint(20) YES NULL
blocking_session_id bigint(20) YES NULL
plan_hash bigint(20) YES NULL
thread_id bigint(20) YES NULL
stmt_type bigint(20) YES NULL
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_wr_active_session_history;
IF(count(*) >= 0, 1, 0)
1

View File

@ -6809,6 +6809,9 @@ IN_FILTER_ROWS tinyint(4) NO 0
GROUP_ID bigint(20) YES NULL
TX_ID bigint(20) YES NULL
BLOCKING_SESSION_ID bigint(20) YES NULL
PLAN_HASH bigint(20) YES NULL
THREAD_ID bigint(20) YES NULL
STMT_TYPE bigint(20) YES NULL
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_ash;
IF(count(*) >= 0, 1, 0)
1
@ -8176,6 +8179,9 @@ event_id bigint(20) YES NULL
group_id bigint(20) YES NULL
tx_id bigint(20) YES NULL
blocking_session_id bigint(20) YES NULL
plan_hash bigint(20) YES NULL
thread_id bigint(20) YES NULL
stmt_type bigint(20) YES NULL
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_wr_active_session_history;
IF(count(*) >= 0, 1, 0)
1