PostgreSQL 列举和停止执行中的 sql

2015-06-25 0 865
PostgreSQL 列举和停止执行中的 sql
    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>'  
    ORDER BY  
        lap DESC;  

遇见资源网 sql PostgreSQL 列举和停止执行中的 sql http://www.ox520.com/17704.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务