可以利用sql binding 的方式处理,例如
create global binding for
select count(1) from sbtest1 a,sbtest1 b
using
select /*+ max_execution_time(1000) */ count(1) from sbtest1 a,sbtest1 b ;
mysql> select count(1) from sbtest1 a,sbtest1 b ;
ERROR 1317 (70100): Query execution was interrupted
这样慢语句就不能执行很久,max_execution_time 应该是可以精确到毫秒级别