Investigate why several tables are analyzed several times per minute
From Andrew N. in production#3875 (comment 525184788)
Considering that table statistics are at the critical to understanding this issue, I feel it's important to understand why several mostly-CI-related tables were being analyzed several times a minute in the immediate run-up to this incident. Is there ever a valid reason to be running ANALYZE
multiple times a minute on large tables in production?
From Andrew N. in production#3875 (comment 525188564)
Also, there did not appear to be a particularly high rate of change on any of these tables (nor any other tables for that matter) around the time of the incident.
Why are these tables getting analyzed so frequently @Finotto?
From Andreas B. in production#3875 (comment 525196040)
Autovacuum operations seem to have a similar rate for these tables (similar to the analyze ops).
We do have the same thresholds configured for auto-vacuum and auto-analyze (autovacuum_vacuum_scale_factor, autovacuum_vacuum_threshold
and their _analyze_
friends), so this is also expected.