Last active
September 1, 2021 07:44
-
-
Save StevenJL/eced77f8510348cff6bc5026babab6f4 to your computer and use it in GitHub Desktop.
Slowest queries right now
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
# See the slowest queries right now | |
SELECT | |
pid, | |
age(clock_timestamp(), query_start) as time_running, | |
substr(query, 0, 75) | |
FROM pg_stat_activity WHERE state != 'idle' | |
ORDER BY time_running DESC; | |
# pid | time_running | query | |
# 123 | 00:00:29 | SELECT users WHERE email ILIKE '%teemo%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment