Home > Database > Mysql Tutorial > body text

Percona5.6自身已支持杀死慢SQL

WBOY
Release: 2016-06-07 14:55:52
Original
1177 people have browsed it

还在为慢SQL而烦恼吗?如今Percona5.6解决了这个问题,这个补丁是由Twitter提供。 通过max_statement_time参数控制(单位毫秒),默认为0,不限制,假如你定义了超过5秒的慢SQL,由DB自动杀死,那么就要设置 setglobalmax_statement_time=5000; 下面通过截图

还在为慢SQL而烦恼吗?如今Percona5.6解决了这个问题,这个补丁是由Twitter提供。


通过max_statement_time参数控制(单位毫秒),默认为0,不限制,假如你定义了超过5秒的慢SQL,由DB自动杀死,那么就要设置

set global max_statement_time = 5000;
Copy after login

下面通过截图,看例子:

wKioL1UGrtCQhzl6AAQTU0RdUuM024.jpg

可以看到,DML/DDL语句全被杀死。


注:开启这个参数,请事先跟开发总监沟通好,避免出现不必要的麻烦。



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!