Last active
September 11, 2015 18:12
-
-
Save wevtimoteo/f65710288532c49f40bc to your computer and use it in GitHub Desktop.
SQL queries to use with PostgreSQL to monitor current executing SQL commands
This file contains hidden or 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
-- activity.sql | |
select procpid, query_start, current_query from pg_stat_activity WHERE current_query <> '<IDLE>' order by query_start | |
-- cancel.sql | |
select pg_cancel_backend(procpid) | |
-- index_stats.sql | |
select * from pg_stat_user_indexes where relname='table_name'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment