当前位置:网站首页>MySQL performance_ Schema common performance diagnosis query
MySQL performance_ Schema common performance diagnosis query
2022-07-07 05:54:00 【wzy0623】
--1、 What kind SQL Execution is the most ?
SELECT DIGEST_TEXT,COUNT_STAR,FIRST_SEEN,LAST_SEEN FROM events_statements_summary_by_digest ORDER BY COUNT_STAR DESC
--2、 What kind of SQL The average response time of is the most ?
SELECT DIGEST_TEXT,AVG_TIMER_WAIT FROM events_statements_summary_by_digest ORDER BY AVG_TIMER_WAIT DESC
--3、 What kind of SQL The largest number of sorted records ?
SELECT DIGEST_TEXT,SUM_SORT_ROWS FROM events_statements_summary_by_digest ORDER BY SUM_SORT_ROWS DESC
--4、 What kind of SQL The largest number of scans ?
SELECT DIGEST_TEXT,SUM_ROWS_EXAMINED FROM events_statements_summary_by_digest ORDER BY SUM_ROWS_EXAMINED DESC
--5、 What kind of SQL Use temporary tables most ?
SELECT DIGEST_TEXT,SUM_CREATED_TMP_TABLES,SUM_CREATED_TMP_DISK_TABLES FROM events_statements_summary_by_digest ORDER BY SUM_CREATED_TMP_TABLES DESC
--6、 What kind of SQL Returns the most result sets ?
SELECT DIGEST_TEXT,SUM_ROWS_SENT FROM events_statements_summary_by_digest ORDER BY SUM_ROWS_SENT DESC
--7、 Which table Physics IO most ?
SELECT file_name,event_name,SUM_NUMBER_OF_BYTES_READ,SUM_NUMBER_OF_BYTES_WRITE FROM file_summary_by_instance ORDER BY SUM_NUMBER_OF_BYTES_READ + SUM_NUMBER_OF_BYTES_WRITE DESC
--8、 Which table logic IO most ?
SELECT object_name,COUNT_READ,COUNT_WRITE,COUNT_FETCH,SUM_TIMER_WAIT FROM table_io_waits_summary_by_table ORDER BY sum_timer_wait DESC
--9、 Which index is the most visited ?
SELECT OBJECT_NAME,INDEX_NAME,COUNT_FETCH,COUNT_INSERT,COUNT_UPDATE,COUNT_DELETE FROM table_io_waits_summary_by_index_usage ORDER BY SUM_TIMER_WAIT DESC
--10、 Which index has never been used ?
SELECT OBJECT_SCHEMA,OBJECT_NAME,INDEX_NAME FROM table_io_waits_summary_by_index_usage WHERE INDEX_NAME IS NOT NULL AND COUNT_STAR = 0 AND OBJECT_SCHEMA not in ('mysql','test') ORDER BY OBJECT_SCHEMA,OBJECT_NAME;
--11、 Which waiting event takes the most time ?
SELECT EVENT_NAME,COUNT_STAR,SUM_TIMER_WAIT,AVG_TIMER_WAIT FROM events_waits_summary_global_by_event_name WHERE event_name != 'idle' ORDER BY SUM_TIMER_WAIT DESC
--12-1、 Dissect a piece of SQL Implementation of , Include statement Information ,stege Information ,wait Information
SELECT EVENT_ID,sql_text FROM events_statements_history WHERE sql_text LIKE '%count(*)%';
--12-2、 Look at the time spent in each phase
SELECT event_id,EVENT_NAME,SOURCE,TIMER_END - TIMER_START FROM events_stages_history_long WHERE NESTING_EVENT_ID = 1553;
--12-3、 Look at the lock wait for each phase
SELECT event_id,event_name,source,timer_wait,object_name,index_name,operation,nesting_event_id FROM events_waits_history_long WHERE nesting_event_id = 1553;
边栏推荐
- 980. 不同路径 III DFS
- Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
- Data storage 3
- Add salt and pepper noise or Gaussian noise to the picture
- [shell] clean up nohup Out file
- SAP ABAP BDC (batch data communication) -018
- Web Authentication API兼容版本信息
- EMMC print cqhci: timeout for tag 10 prompt analysis and solution
- Flink SQL realizes reading and writing redis and dynamically generates hset key
- [daily training -- Tencent selected 50] 292 Nim games
猜你喜欢
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先
SQL query: subtract the previous row from the next row and make corresponding calculations
C nullable type
Pytorch builds neural network to predict temperature
随机生成session_id
404 not found service cannot be reached in SAP WebService test
WEB架构设计过程
[云原生]微服务架构是什么?
判断文件是否为DICOM文件
Distributed global ID generation scheme
随机推荐
盘点国内有哪些EDA公司?
pytorch_ 01 automatic derivation mechanism
数字IC面试总结(大厂面试经验分享)
谈fpga和asic的区别
每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)
R language [logic control] [mathematical operation]
Type de texte de commutation d'entrée et de mot de passe de l'applet natif
Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou
linear regression
Hcip seventh operation
MySQL-CentOS7通过YUM安装MySQL
数据中心为什么需要一套基础设施可视化管理系统
What EDA companies are there in China?
Harmonyos practice - Introduction to development, analysis of atomized services
Determine whether the file is a DICOM file
zabbix_get测试数据库失败
async / await
"Multimodal" concept
980. 不同路径 III DFS
yarn入门(一篇就够了)