ANALYZE gathers statistics for the query planner to create the most efficient query execution paths. Per PostgreSQL documentation, accurate statistics will help the planner to choose the most appropriate query plan, and thereby improve the speed of query processing.
This alert utilizes pg_stat_user_tables to let you know how old a given relation(s) statistics are.
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: Last Analyze
Execution Interval: 8 hours -- You may want to change the interval based on your database workload.
Notification Text: Empty
select schemaname ||'.'||relname, extract(hour FROM now()-last_analyze) from pg_stat_user_tables where last_analyze is not null;
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.