It's important to identify and investigate if there are any long running vacuum queries in your PostgreSQL database(s). These long running queries may interfere in overall database performance and could be the result of a stuck background process.
This alert utilizespg_stat_activityto monitor all vacuum related queries and notifies you if there are running longer than the defined thresholds.
To create the alert, click on Alerts > Manage Alerts tab and create a Custom Alert of type Custom SQL Alert - Multiple Numeric Return. Configure the alert with values similar to these:
Alert Name: Long running vacuum queries
Execution Interval: 10 minutes -- You may want to change the interval based on your database workload.
Notification Text: Empty
SELECT pid ||' : '|| query, extract(hours from now() - pg_stat_activity.query_start) AS duration FROM pg_stat_activity WHERE query like '%vacuum:%' and query_start is not null and extract(hours from now() - pg_stat_activity.query_start) > 5.5
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community.
More than 150,000 members are here to solve problems, share technology and best practices, and directly
contribute to our product development process.