Re: Avoiding out of date statistics / planner

2020-02-13 Thread Tim Kane
That looks very useful indeed. Thanks Tomas On Wed, Feb 12, 2020 at 8:32 PM Tomas Vondra wrote: > On Wed, Feb 12, 2020 at 10:23:22AM -0700, Michael Lewis wrote: > >It may also be worth noting that it is possible to make autovacuum/analyze > >more aggressive, perhaps only on the tables that see

Re: Avoiding out of date statistics / planner

2020-02-12 Thread Tomas Vondra
On Wed, Feb 12, 2020 at 10:23:22AM -0700, Michael Lewis wrote: 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

Re: Avoiding out of date statistics / planner

2020-02-12 Thread Michael Lewis
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

Re: Avoiding out of date statistics / planner

2020-02-12 Thread Tom Lane
Tim Kane writes: > Every now and again, I will encounter an unexplained long-running query. > It’s a head scratcher moment, because this query that is still running for > 20 minutes (not blocking) can be run independently in about 500ms Without some kind of context (like, have you been doing

Avoiding out of date statistics / planner

2020-02-12 Thread Tim Kane
Every now and again, I will encounter an unexplained long-running query. It’s a head scratcher moment, because this query that is still running for 20 minutes (not blocking) can be run independently in about 500ms I can only assume that the problem query ran against the table(s) at a time when