Last active
September 2, 2017 20:19
-
-
Save dat-boris/28d5975217c174b7c0c88fbf2fd5b4ab to your computer and use it in GitHub Desktop.
Finding and releasing locks on Redshift
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
| select * from | |
| stv_locks | |
| left join stv_recents on pid = lock_owner_pid; | |
| -- http://docs.aws.amazon.com/redshift/latest/dg/PG_TERMINATE_BACKEND.html | |
| select * from svv_transactions t | |
| left join stv_recents r on r.pid = t.pid | |
| order by txn_start; | |
| -- Query for killing jobs: | |
| -- cancel 29078; | |
| -- Terminating entire process | |
| -- https://stackoverflow.com/questions/18866865/difference-between-terminating-and-cancelling-a-process | |
| -- select pg_terminate_backend(29078); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment