-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
display function optimization (#682)
* Rename Dockerfile to DockerFile * add storage_method.yaml * add storage_method.yaml * display function optimization * display function optimization
- Loading branch information
Showing
13 changed files
with
72 additions
and
125 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
plugins/display/tasks/observer/obtab.yaml → ...s/display/tasks/observer/inner_table.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
info_en: "[obtab]" | ||
info_cn: "[ob内部表信息]" | ||
command: obdiag display scene run --scene=observer.obtab --env tablename=test | ||
info_en: "[inner_table]" | ||
info_cn: "[内部表信息模糊匹配]" | ||
command: obdiag display scene run --scene=observer.inner_table --env tablename=test | ||
task: | ||
- version: "[*,*]" | ||
steps: | ||
- type: sql | ||
sql: "SELECT distinct table_name FROM oceanbase.__all_virtual_table t1 JOIN oceanbase.__all_virtual_database t2 ON t2.database_id = t1.database_id JOIN oceanbase.__all_tenant t3 ON t3.tenant_id = t1.tenant_id WHERE tenant_name = 'sys' AND database_name = 'oceanbase' AND (table_name LIKE '__all%' OR table_name LIKE '__tenant%' OR table_name LIKE 'gv%' OR table_name LIKE 'v%' OR table_name LIKE 'dba%' OR table_name LIKE 'cdb%') and table_name like '%#{tablename}%' ORDER BY ORA_DECODE(SUBSTR(table_name, 1, 1), 'v', 3, 'g', 4, ORA_DECODE(SUBSTR(table_name, 3, 1), 'a', 2, 1)), table_name;" | ||
global: true | ||
global: true |
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
plugins/display/tasks/observer/locktab.yaml → ...ns/display/tasks/observer/lock_table.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
info_en: "[lock holder info]" | ||
info_cn: "[查看锁等待]" | ||
command: obdiag display scene run --scene=observer.lockholder --env db_connect='-h127.0.0.1 -P2881 -utest@test -p****** -Dtest' | ||
command: obdiag display scene run --scene=observer.lockholder | ||
task: | ||
- version: "[4.0.0.0, *]" | ||
- version: "[*,4.0.0]" | ||
steps: | ||
- type: sql | ||
sql: " select /*+ READ_CONSISTENCY(WEAK) query_timeout(100000000)*/ concat(case block | ||
when 0 then 'Holder:' | ||
when 1 then 'Waiter:' | ||
end, op.svr_ip, ':', op.id) as sess, | ||
ol.id1, ol.id2, ol.lmode, ol.request, ol.type, round(ol.ctime/1000/1000,0) ctime, op.info, op.command, if(op.sql_id = '', 'NULL', op.sql_id) sql_id, do.owner, do.object_name | ||
from oceanbase.gv$ob_locks ol, oceanbase.gv$ob_processlist op, oceanbase.dba_objects do, | ||
(select id1, id2, type from oceanbase.gv$ob_locks where type = 'TR' and block = 1) l | ||
where ol.id1 = l.id1 and ol.id2= l.id2 | ||
and ol.trans_id = op.trans_id | ||
and ol.id1 = do.data_object_id | ||
order by id1, id2, ctime desc, block asc;" | ||
sql: "select distinct a.svr_ip,c.table_id table_actual_id,c.table_name,a.session_id,a.block_session_id,a.lock_mode,a.type | ||
from oceanbase.__all_virtual_lock_wait_stat a | ||
left join oceanbase.__all_virtual_table c on a.table_id=c.table_id order by c.table_name;" | ||
global: true | ||
- version: "[4.0.0,*]" | ||
steps: | ||
- type: sql | ||
sql: "select distinct a.tenant_id,a.svr_ip,c.table_id table_actual_id,c.table_name,a.tablet_id,a.session_id,a.block_session_id,a.trans_id, | ||
a.holder_trans_id,a.lock_mode,a.type | ||
from oceanbase.__all_virtual_lock_wait_stat a | ||
left join oceanbase.__all_virtual_tablet_to_ls b on b.tablet_id=a.tablet_id and a.tenant_id=b.tenant_id and a.ls_id=b.ls_id | ||
left join oceanbase.__all_virtual_table c on b.table_id=c.table_id order by c.table_name,a.tenant_id;" | ||
global: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
plugins/display/tasks/observer/mem.yaml → plugins/display/tasks/observer/mermory.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
plugins/display/tasks/observer/lvss.yaml → ...play/tasks/observer/processlist_stat.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
info_en: "[tabndv]" | ||
info_cn: "[查询表ndv信息]" | ||
info_cn: "[查询表 ndv 信息]" | ||
command: obdiag display scene run --scene=observer.tabndv --env user_name=test --env table_name=test | ||
task: | ||
- version: "[*,4.0.0.0]" | ||
steps: | ||
- type: sql | ||
sql: "select t.database_name, | ||
t.table_name, | ||
c.column_name, | ||
(case c.data_type | ||
when 22 then 'VARCHAR2' when 17 then 'DATE' when 15 then 'NUMBER' when 38 then 'TIMESTAMP' when 30 then 'CLOB/BLOB' when 23 then 'CHAR' when 42 then 'FLOAT' when 39 then 'RAW' when 44 then 'NCHAR' when 43 then 'NVARCHAR2' else c.data_type end) AS COLUMN_TYPE, | ||
SUM(s.num_distinct) as NDV, | ||
sum(s.num_null) as num_null | ||
from oceanbase.gv$table t | ||
inner join oceanbase.__all_virtual_column c on t.table_id = c.table_id | ||
inner join oceanbase.__all_virtual_column_statistic s on t.table_id = s.table_id and c.column_id = s.column_id | ||
where t.table_name = upper('#{table_name}') | ||
and t.database_name = upper('#{user_name}') | ||
group by t.database_name, t.table_name, c.column_name,c.data_type;" | ||
t.table_name, | ||
c.column_name, | ||
(case c.data_type | ||
when 22 then 'VARCHAR2' when 17 then 'DATE' when 15 then 'NUMBER' when 38 then 'TIMESTAMP' when 30 then 'CLOB/BLOB' when 23 then 'CHAR' when 42 then 'FLOAT' when 39 then 'RAW' when 44 then 'NCHAR' when 43 then 'NVARCHAR2' else c.data_type end) AS COLUMN_TYPE, | ||
SUM(s.num_distinct) as NDV, | ||
sum(s.num_null) as num_null | ||
from oceanbase.gv$table t | ||
inner join oceanbase.__all_virtual_column c on t.table_id = c.table_id | ||
inner join oceanbase.__all_virtual_column_statistic s on t.table_id = s.table_id and c.column_id = s.column_id | ||
where t.table_name = upper('#{table_name}') | ||
and t.database_name = upper('#{user_name}') | ||
group by t.database_name, t.table_name, c.column_name,c.data_type;" | ||
global: true | ||
- type: sql | ||
sql: "select a.svr_ip, | ||
c.database_name, | ||
tb.table_name,b.part_id, | ||
b.part_name,b.part_high_bound part_high_value,b.part_func_type,b.subpart_id,b.subpart_name,b.subpart_high_bound subpart_high_value,b.subpart_func_type, | ||
a.row_count | ||
from oceanbase.__all_virtual_table tb join | ||
oceanbase.__all_virtual_partition_table a on a.table_id = tb.table_id join | ||
oceanbase.__all_virtual_database c on c.database_id = tb.database_id left join | ||
oceanbase.__all_virtual_partition_item b on a.partition_id = b.partition_id and a.table_id = b.table_id | ||
where tb.table_name = upper('#{table_name}') | ||
and c.database_name = upper('#{user_name}') and a.role=1 order by 4,8;" | ||
global: true | ||
c.database_name, | ||
tb.table_name,b.part_id, | ||
b.part_name,b.part_high_bound part_high_value,b.part_func_type,b.subpart_id,b.subpart_name,b.subpart_high_bound subpart_high_value,b.subpart_func_type, | ||
a.row_count | ||
from oceanbase.__all_virtual_table tb join | ||
oceanbase.__all_virtual_partition_table a on a.table_id = tb.table_id join | ||
oceanbase.__all_virtual_database c on c.database_id = tb.database_id left join | ||
oceanbase.__all_virtual_partition_item b on a.partition_id = b.partition_id and a.table_id = b.table_id | ||
where tb.table_name = upper('#{table_name}') | ||
and c.database_name = upper('#{user_name}') and a.role=1 order by 4,8;" | ||
global: true | ||
|
||
- version: "[4.0.0.0,*]" | ||
steps: | ||
- type: sql | ||
sql: "select | ||
s.OWNER,s.TABLE_NAME,s.COLUMN_NAME,s.NUM_DISTINCT as ndv,s.NUM_NULLS,s.LAST_ANALYZED,(case c.data_type | ||
when 22 then 'VARCHAR2' when 17 then 'DATE' when 15 then 'NUMBER' when 38 then 'TIMESTAMP' when 30 then 'CLOB/BLOB' when 23 then 'CHAR' when 42 then 'FLOAT' when 39 then 'RAW' when 44 then 'NCHAR' when 43 then 'NVARCHAR2' else c.data_type end) AS COLUMN_TYPE | ||
from oceanbase.CDB_TAB_COL_STATISTICS s | ||
inner join oceanbase.__all_database d on s.OWNER=d.database_name | ||
inner join oceanbase.__all_virtual_table t on s.TABLE_NAME=t.TABLE_NAME and s.CON_ID=t.tenant_id and d.database_id=t.database_id | ||
inner join oceanbase.__all_virtual_column c on t.table_id = c.table_id and c.COLUMN_NAME=s.COLUMN_NAME | ||
where s.table_name = upper('{#table_name}') | ||
and s.OWNER=upper('#{user_name}');" | ||
global: true | ||
sql: "select | ||
s.OWNER,s.TABLE_NAME,s.COLUMN_NAME,s.NUM_DISTINCT as ndv,s.NUM_NULLS,s.LAST_ANALYZED,(case c.data_type | ||
when 22 then 'VARCHAR2' when 17 then 'DATE' when 15 then 'NUMBER' when 38 then 'TIMESTAMP' when 30 then 'CLOB/BLOB' when 23 then 'CHAR' when 42 then 'FLOAT' when 39 then 'RAW' when 44 then 'NCHAR' when 43 then 'NVARCHAR2' else c.data_type end) AS COLUMN_TYPE | ||
from oceanbase.CDB_TAB_COL_STATISTICS s | ||
inner join oceanbase.__all_database d on s.OWNER=d.database_name | ||
inner join oceanbase.__all_virtual_table t on s.TABLE_NAME=t.TABLE_NAME and s.CON_ID=t.tenant_id and d.database_id=t.database_id | ||
inner join oceanbase.__all_virtual_column c on t.table_id = c.table_id and c.COLUMN_NAME=s.COLUMN_NAME | ||
where s.table_name = upper('{#table_name}') | ||
and s.OWNER=upper('#{user_name}');" | ||
global: true |