Created
November 15, 2021 17:02
-
-
Save rbreslow/2974ab7cb2e4634e115275a5ab4800e6 to your computer and use it in GitHub Desktop.
This file contains 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 characters
SELECT | |
client_addr, | |
query_start, | |
state_change, | |
wait_event, | |
state, | |
EXTRACT(epoch FROM (state_change - query_start)) AS execution_duration, | |
EXTRACT(epoch FROM (CURRENT_TIMESTAMP - query_start)) AS total_duration, | |
query | |
FROM | |
pg_stat_activity | |
WHERE | |
wait_event IS NOT NULL | |
AND application_name = '' | |
AND client_addr NOT IN ('10.0.0.247', '127.0.0.1') | |
AND backend_type = 'client backend'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment