7.16. sql超时

添加对超时SQL的处理,一个SQL可以添加超时时间,如果超过超时时间可以cancel掉。

  1. 通过cl.sql.execute.timeout.secs在配置文件中设置select查询的默认超时时间,默认600秒

  2. 通过cl.sql.execute.timeout.longtime.secs在配置文件中设置insert@load@create@export的超时时间,默认 30天(该参数配置后同时对select生效,如与第一点中参数同时配置则再select查询时取最小值生效,故建议若需要两者同时配置,需保证本处所配参数值大于第一点中参数值)

  3. 通过注解,动态设置sql的执行时间 /sys_timeout_kill_secs(3)/

    /*sys_timeout_kill_secs(3)*/ select count(*) from  (select * from tcp_test where partition like '20200302') tmp   limit 20;
    
    /*sys_timeout_kill_secs(3)*/ select LogType,TransProto, sum(RecHour) from tcp_test where partition like '20200101'   group by LogType,TransProto;
    
    /*sys_timeout_kill_secs(3)*/ select LogType,TransProto, sum(RecHour) from tcp_test where partition like '20200101'   group by LogType,TransProto  limit 10 ;
    
Copyright © lucene.xin 2020 all right reserved修改时间: 2021-07-02 11:42:23

results matching ""

    No results matching ""