mysql 限制sql执行时间


mysql 5.7.8开始

max_execution_time applies to read-only SELECT statements.

 

mysql> show variables like 'max_execution_time';       

+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_execution_time | 10000  |
+--------------------+-------+
1 row in set (0.00 sec)

 

目前只支持select 语句 

 

或者用如下用法 :

select /*+ max_execution_time(3000)*/ count(*) from t1 where status=0;

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM