It may also be worth noting that it is possible to make autovacuum/analyze more aggressive, perhaps only on the tables that see large changes in data that might result in a statistics issue. If you could share a query, explain analyze output, and pseudo code or at least description of what sort of bulk operations are being done, then more insight could be offered.
- Avoiding out of date statistics / planner Tim Kane
- Re: Avoiding out of date statistics / planner Tom Lane
- Re: Avoiding out of date statistics / planner Michael Lewis
- Re: Avoiding out of date statistics / planner Tomas Vondra