当前位置:网站首页>Troubleshooting of tool failure caused by Chinese characters in PT kill query
Troubleshooting of tool failure caused by Chinese characters in PT kill query
2022-07-28 10:23:00 【Two dogs don't run】
The production environment encountered several YearningSQL Slow queries triggered by the platform ( The sql The resulting Cartesian product is too large , There is no result , R & D triggers the query again in the front-end interface ), Finally, the database CPU Dragging up .
DBA After emergency intervention , according to mysql Server show full processlist Grab relevant sql, The execution time has exceeded 120s. First record the scene , then kill Drop the correlation query.
query It's like this :
select
aa AS A Column ,
bb as B Column
FROM sbtest.sbtest1
where aa = 'abcdefg'
order by update_time desc
LIMIT 100;Compare the background operation logs , Confirm that this is where the R & D students are YearningSQL The query interface is submitted many times query.
however , We went online a few months ago pt-kill Timing task , Aim at YearningSQL The user query of the platform has done 60 Seconds of query timeout fuse . In theory, even if there is such a slow sql It will not take too long .
Look up the pt-kill Recent logs of , I found some hints :
Wide character in print at pt-kill line 7373
Turn down the corresponding code segment , The following parts :
According to the above sql, Basically, it can be judged that perl Encountered Chinese character processing failure during script execution .
Found the reason , The solution is simple :
stay pt-kill The file header , Add 2 Line code :
use utf8;
use open ":encoding(utf8)",":std";In addition, for some complex queries , Some suggestions are given to R & D students :
1、 It is recommended to explain Self assessment
2、 Querying , You can explicitly define 60 Second timeout , for example SELECT /*+ MAX_EXECUTION_TIME(60000) */ * FROM t1 INNER JOIN t2 WHERE ... 【5.7 And above 】
边栏推荐
猜你喜欢

7. Dichotomy -- find a set of repeated or ordered but rotating arrays
![[wechat applet] project practice - lottery application](/img/7b/a0545f077259b3dc971dc246813177.png)
[wechat applet] project practice - lottery application

C language secondary pointer explanation and example code

MySQL架构原理

Choosing a supplier service system is the first step for large health industry enterprises to move towards digital transformation

Multithreading and high concurrency (III) -- source code analysis AQS principle

5、动态规划---斐波那契数列

7、二分法——寻找一组重复或者有序但是旋转的数组

定了!就在7月30日!

5. Dynamic programming -- Fibonacci series
随机推荐
Summary of key points of bank entry examination
Digital transformation scheme of real estate: all-round digital intelligence system operation, helping real estate enterprises improve the effectiveness of management and control
Hurun released the 2020 top 10 Chinese chip design private enterprises: Huawei Hisilicon did not appear on the list!
记录一次idea中的父子项目修改project与module名称,亲测!
LIBCMTD.lib
leetcode——旋转数组的最小数字
Pl/sql server syntax explanation
Sort - quick sort (fast and slow pointer Implementation)
排序——快速排序(快慢指针实现)
Consul
Elk real time log analysis platform
5. Dynamic programming -- Fibonacci series
Netease written test No. 2 -- typical application of European distance
问题总结档案
Etcd (highly available kV database)
谈谈基于JS实现阻止别人调试通过控制台调试网站的问题
pt-kill 查询中包含中文字符 导致工具失效的排查
10. The penultimate node in the linked list
PHP generates QR code (learning)
8、数组中出现次数超过一半的数字