■ 1분 이상 실행되는 쿼리 조회하기

------------------------------------------------------------------------------------------------------------------------

 

SELECT

    CURRENT_TIMESTAMP - QUERY_START AS RUNTIME

   ,DATNAME

   ,USENAME

   ,QUERY

FROM  PG_STAT_ACTIVITY

WHERE STATE = 'active'

AND   CURRENT_TIMESTAMP - QUERY_START > '1 MIN'

ORDER BY 1 DESC;

 

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG