Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created January 23, 2021 08:32
Show Gist options
  • Select an option

  • Save StevenJL/d7459afa3e344e0132833107688f0205 to your computer and use it in GitHub Desktop.

Select an option

Save StevenJL/d7459afa3e344e0132833107688f0205 to your computer and use it in GitHub Desktop.
Write Queries to table
SELECT * FROM pg_stat_activity
WHERE state != 'idle'
AND query NOT ILIKE '%SELECT%'
AND query ILIKE '%some_big_table%'
AND query NOT ILIKE '%pg_stat_activity%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment