mysql 5.7.8开始
applies to read-only 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;