Re: Understanding bad estimate (related to FKs?)

2020-11-02 Thread Tomas Vondra
On Mon, Nov 02, 2020 at 03:08:12PM -0500, Tom Lane wrote: Philip Semanchuk writes: The query I asked about in the original post of this thread has 13 relations in it. IIUC, that's 13! or > 6 billion possible plans. How did the planner pick one plan out of 6 billion? I'm curious, both for prac

Re: Understanding bad estimate (related to FKs?)

2020-11-02 Thread Michael Lewis
> > The query I asked about in the original post of this thread has 13 > relations in it. IIUC, that's 13! or > 6 billion possible plans. How did > the planner pick one plan out of 6 billion? I'm curious, both for practical > purposes (I want my query to run well) and also because it's fascinating.

Re: Understanding bad estimate (related to FKs?)

2020-11-02 Thread Guillaume Lelarge
Hi, Le lun. 2 nov. 2020 à 20:09, Philip Semanchuk a écrit : > > > > On Oct 31, 2020, at 9:53 AM, Guillaume Lelarge > wrote: > > > > Hi, > > > > Le ven. 30 oct. 2020 à 15:57, Philip Semanchuk < > phi...@americanefficient.com> a écrit : > > > > > > > On Oct 29, 2020, at 6:48 PM, Tomas Vondra < >

Re: Understanding bad estimate (related to FKs?)

2020-11-02 Thread Tom Lane
Philip Semanchuk writes: > The query I asked about in the original post of this thread has 13 relations > in it. IIUC, that's 13! or > 6 billion possible plans. How did the planner > pick one plan out of 6 billion? I'm curious, both for practical purposes (I > want my query to run well) and als

Re: Understanding bad estimate (related to FKs?)

2020-11-02 Thread Justin Pryzby
On Mon, Nov 02, 2020 at 02:09:03PM -0500, Philip Semanchuk wrote: > Bien merci, yes, I've visited most of those links and learned an enormous > amount from them. I've downloaded many of them for re-reading, including > yours. :-) It's helpful to be reminded of them again. > > EXPLAIN ANALYZE tel

Re: Understanding bad estimate (related to FKs?)

2020-11-02 Thread Philip Semanchuk
> On Oct 31, 2020, at 9:53 AM, Guillaume Lelarge wrote: > > Hi, > > Le ven. 30 oct. 2020 à 15:57, Philip Semanchuk > a écrit : > > > > On Oct 29, 2020, at 6:48 PM, Tomas Vondra > > wrote: > > > > On Thu, Oct 29, 2020 at 11:25:48AM -0400, Philip Semanchuk wrote: > >> > >> > >>> On Oct