Created
February 25, 2021 19:20
-
-
Save goosemania/06c8d2c46e512ff9531ab32292ea1702 to your computer and use it in GitHub Desktop.
Age of running queries in PostgreSQL
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, query_start, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment