Created
August 30, 2018 22:40
-
-
Save jeffersonsouza/8cfbef0d04c3ea51feae14300d6a6008 to your computer and use it in GitHub Desktop.
Revisions
-
jeffersonsouza created this gist
Aug 30, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ -- Get active queries with duration greater than 1 sec SELECT (now() - query_start) as duracao, pid, query, usename, datname FROM pg_stat_activity WHERE state = 'active' AND query_start < now() - '1 seconds'::interval AND pid <> pg_backend_pid() ORDER BY query_start ASC