Last active
June 9, 2023 10:41
-
-
Save source-c/93268d8880974eecae59c188bfc8d7b8 to your computer and use it in GitHub Desktop.
PG list queries that running longer than 1 minute
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 | |
pid, | |
user, | |
pg_stat_activity.query_start, | |
now() - pg_stat_activity.query_start AS query_time, | |
query, | |
state, | |
wait_event_type, | |
wait_event | |
FROM pg_stat_activity | |
WHERE (now() - pg_stat_activity.query_start) > interval '1 minutes'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment