MySQL - can I limit the maximum time allowed for a query to run?

后端 未结 4 1028
[愿得一人]
[愿得一人] 2020-11-27 19:39

I\'m looking for a way to limit the max running time of a query on mysql server. I figured this could be done through the my.cnf configuration file, but couldn\

4条回答
  •  情书的邮戳
    2020-11-27 20:14

    In the meantime the Twitter team released their changes to MySQL which implements this:

    - Reduce unnecessary work through improved server-side statement timeout support. This allows the server to proactively cancel queries that run longer than a millisecond-granularity timeout.

    See http://engineering.twitter.com/2012/04/mysql-at-twitter.html and https://github.com/twitter/mysql/wiki/Statement-Timeout

提交回复
热议问题