当前位置:网站首页>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;边栏推荐
- 话说SQLyog欺骗了我!
- 架构设计的五个核心要素
- 【Shell】清理nohup.out文件
- Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
- 判断文件是否为DICOM文件
- 微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
- Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
- 目标检测中的BBox 回归损失函数-L2,smooth L1,IoU,GIoU,DIoU,CIoU,Focal-EIoU,Alpha-IoU,SIoU
- Red Hat安装内核头文件
- Get the way to optimize the one-stop worktable of customer service
猜你喜欢
![R language [logic control] [mathematical operation]](/img/93/06a306561e3e7cb150d243541cc839.png)
R language [logic control] [mathematical operation]

《ClickHouse原理解析与应用实践》读书笔记(6)

Lombok plug-in

数字IC面试总结(大厂面试经验分享)

Differences and introduction of cluster, distributed and microservice
![Paper reading [semantic tag enlarged xlnv model for video captioning]](/img/e3/633f6aac7a51ad7b3dc0e45dbe1f60.png)
Paper reading [semantic tag enlarged xlnv model for video captioning]
![Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]](/img/9c/1f031400f0e201df47bd51547ff73f.png)
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]

The 2022 China low / no code Market Research and model selection evaluation report was released

驱动开发中platform设备驱动架构详解

毕业之后才知道的——知网查重原理以及降重举例
随机推荐
SAP ABAP BDC (batch data communication) -018
How to get free traffic in pinduoduo new store and what links need to be optimized in order to effectively improve the free traffic in the store
Nvisual network visualization
Go language context explanation
拼多多新店如何获取免费流量,需要从哪些环节去优化,才能有效提升店内免费流量
一个简单的代数问题的求解
Distributed global ID generation scheme
Interview skills of software testing
PTA 天梯赛练习题集 L2-002 链表去重
English grammar_ Noun possessive
原生小程序 之 input切换 text与password类型
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
Sidecar mode
驱动开发中platform设备驱动架构详解
牙齿干细胞的存储问题(未完待续)
linear regression
sql查询:将下一行减去上一行,并做相应的计算
Randomly generate session_ id
Go 語言的 Context 詳解
404 not found service cannot be reached in SAP WebService test