当前位置:网站首页>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 】
边栏推荐
- 4. Adjust the array order so that odd numbers precede even numbers
- 配置树莓派,过程和遇到问题
- 第一篇:UniAPP的小程序跨端开发-----创建uniapp项目
- Install MySQL under centos7, and the online articles are not accurate
- Multithreading and high concurrency (III) -- source code analysis AQS principle
- jvm原理
- Summary of key points of bank entry examination
- ogg里用多个filter语法应该怎么写?
- 利用正则表达式从文件路径中匹配文件名
- MySQL的SQL TRACE一例
猜你喜欢

初识SuperMap iDesktop

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

巧用ngx_lua做流量分组

uni-app项目目录、文件作用介绍 及 开发规范

语音聊天app——如何规范开发流程?

API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试

14. Double pointer - the container that holds the most water

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

Digital transformation scheme of real estate: all-round digital intelligence system operation, helping real estate enterprises improve the effectiveness of management and control

7. Dichotomy -- find a set of repeated or ordered but rotating arrays
随机推荐
ogg参数filter的使用问题【急】
Record a parent-child project in idea, modify the name of project and module, and test it personally!
Double pointer technique
select如果不加order by子句,返回结果的顺序是不可靠的
Voice chat app - how to standardize the development process?
读写分离备机备份报错
Digital transformation scheme of real estate: all-round digital intelligence system operation, helping real estate enterprises improve the effectiveness of management and control
吴雄昂遭Arm罢免内幕:建私人投资公司,损害了股东利益?
Leetcode076 -- the kth largest number in the array
string matching
双指针技巧
KingbaseES V8R6 JDBC 能否使用VIP ?
Kubernetes
Talk about the problem of preventing others from debugging websites through console based on JS implementation
6. Double pointer -- the sum of the two numbers of the incremental array is equal to the target number
13、哈希表——两个链表第一个公共节点
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
10 minute quick start EVs [play Huawei cloud]
Uni app advanced life cycle
What are the highlights of B2B2C system? How to help jewelry enterprises build an omni channel multi merchant mall management system