-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve pg_stat_activity query. (#92)
Partial changes by @CyberDem0n When joining pg_locks there is no need to consider every single locktype independantly to figure out which rows should be used for join. Join on all possible rows with using 'IS NOT DISTINCT FROM' works the same and easy to read and support. Query will return unique list of pids in locked_by For 9.6 use pg_blocking_pids instead of retrieving list of pids from pg_locks. The old technique is too obscure and doesn't really work for parallel queries. In addition to that reformat all queries to look similar. report only heavy-weight locks ('Lock' wait_event_type) in pg_stat_activity for the 'locked' status in pg_view.
- Loading branch information
1 parent
e4d7018
commit de5325a
Showing
1 changed file
with
65 additions
and
114 deletions.
There are no files selected for viewing
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