标签:status 关联 inux 做了 快速定位 哪些 写文件 删除 详细
show processlist; show full processlist; select * from information_schema.processlist;
其中,show processlist为简要查看当前连接数据库情况,包含SQL语句的statement列仅提供部分SQL,而show full processlist则提供完整的SQL 语句,information_schema.processlist的内容与show full processlist 内容一致,但是可以以表格查询的形式添加where条件,达到自己的使用需求。
select * from sys.processlist; select * from sys.session; select * from sys.x$processlist; select * from sys.x$session;
select table_schema,table_name,sum(io_read_requests+io_write_requests) io from schema_table_statistics group by table_schema,table_name order by io desc limit 10; +--------------+----------------------------------+------+ | table_schema | table_name | io | +--------------+----------------------------------+------+ | ycf_sqlpub | django_session | 2194 | | dba_sqlpub | django_session | 735 | | ycf_sqlpub | sqlversion_registersql | 347 | | ycf_sqlpub | xadmin_log | 331 | | ycf_sqlpub | sqlversion_registersqllog_sqls | 329 | | ycf_sqlpub | sqlversion_sqlpublishlog_version | 311 | | ycf_sqlpub | sqlversion_sqlpublishlog | 308 | | ycf_sqlpub | sqlversion_registersqllog | 299 | | ycf_sqlpub | auth_group_permissions | 298 | | ycf_sqlpub | testenv_testalldb | 295 | +--------------+----------------------------------+------+
# 冗余索引查看 select table_schema,table_name,redundant_index_name,redundant_index_columns,dominant_index_name,dominant_index_columns from sys.schema_redundant_indexes; # 未使用索引查看 select * from schema_unused_indexes;
select * from schema_auto_increment_columns \G
select * from sys.statements_with_full_table_scans where db = ‘test‘;
select file,avg_read+avg_write as avg_io from io_global_by_file_by_bytes order by avg_io desc limit 10;
标签:status 关联 inux 做了 快速定位 哪些 写文件 删除 详细
原文地址:https://www.cnblogs.com/VicLiu/p/12640973.html