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