标签:des style blog color strong os
查看所有postgre语句执行时间:
select procpid, start, now() - start as lap, current_query from (select backendid, pg_stat_get_backend_pid(s.backendid) as procpid, pg_stat_get_backend_activity_start(s.backendid) as start, pg_stat_get_backend_activity(s.backendid) as current_query from (select pg_stat_get_backend_idset() as backendid) as s ) as s where current_query <> ‘<IDLE>‘ --and procpid = 17637 order by lap desc;
怎样停止正在执行的sql?
优雅的方法:SELECT pg _cancel_backend(进程id);
或者用系统函数:kill -9 进程id;
查看postgre都有哪些语句执行时间长,布布扣,bubuko.com
标签:des style blog color strong os
原文地址:http://www.cnblogs.com/liqiu/p/3817779.html