当前位置:网站首页>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 】
边栏推荐
- 在mt6735中添加新的开机logo与开\关机动画
- Small knowledge in Oracle
- a different object with the same identifier value was already associated with the session
- QT | some summaries of signals and slots
- 定了!就在7月30日!
- 【微信小程序】项目实战—抽签应用
- 按位与、或、异或等运算方法
- B2B e-commerce website scheme for building materials industry: enable the transformation and upgrading of building materials enterprises to achieve cost reduction and efficiency improvement
- 12、双指针——合并两个有序链表
- 配置树莓派,过程和遇到问题
猜你喜欢

C language secondary pointer explanation and example code

Why should I take the first-class constructor examination? How high is the gold content of the first-class Constructor Certificate?

Skillfully use NGX_ Lua makes traffic grouping

巧用ngx_lua做流量分组

数据库安全 --- 创建登录名 用户+配置权限【笔记】

SQL Server 2016 学习记录 --- 数据更新

Typora使用教程

Record a parent-child project in idea, modify the name of project and module, and test it personally!

Match file names from file paths using regular expressions

7. Dichotomy -- find a set of repeated or ordered but rotating arrays
随机推荐
Lucene 查询语法备忘
a different object with the same identifier value was already associated with the session
16、字符串反转
管道、管程、管态的区别
6. Double pointer -- the sum of the two numbers of the incremental array is equal to the target number
select如果不加order by子句,返回结果的顺序是不可靠的
2021-10-13arx
IE兼容性问题处理
a different object with the same identifier value was already associated with the session
ogg里用多个filter语法应该怎么写?
Summary of key points of bank entry examination
[cloud co creation] enterprise digital transformation, Huawei cloud consulting is with you
Record a parent-child project in idea, modify the name of project and module, and test it personally!
PL/SQL server语法详解
centos7下安装mysql,网上文章都不太准
双指针技巧
Sort - quick sort (fast and slow pointer Implementation)
16. String inversion
uni-app进阶之生命周期
Qt | 信号和槽的一些总结