Re: [HACKERS] Highly Variable Planning Times - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] Highly Variable Planning Times
Date
Msg-id 20170419234840.qubw2fdaeijoc4cu@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] Highly Variable Planning Times  (Michael Malis <michaelmalis2@gmail.com>)
Responses Re: [HACKERS] Highly Variable Planning Times  (Michael Malis <michaelmalis2@gmail.com>)
List pgsql-hackers
On 2017-04-19 16:43:07 -0700, Michael Malis wrote:
> > The profile seems to confirm that this is largely due to cache misses.
> 
> Can you elaborate? Cache misses of what? Why is the planning time so
> variable?

Postgres uses caches for a lot of metadata of tables, indexes, ... Some
actions, like vacuum, DDL, table size changes trigger cache
invalidations for other backends so the caches stay coherent.  What
you're likely seeing is that the cached cases are quick enough, and that
the slow plan cycles are when the cache has been invalidated.

- Andres



pgsql-hackers by date:

Previous
From: Michael Malis
Date:
Subject: Re: [HACKERS] Highly Variable Planning Times
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Unportable implementation of background worker start