Re: SV: bad plan using nested loops

2018-02-05 Thread Tomas Vondra
On 02/02/2018 10:02 AM, Johan Fredriksson wrote: > tor 2018-02-01 klockan 20:34 + skrev Johan Fredriksson: >>> Johan Fredriksson writes: Bad plan: https://explain.depesz.com/s/avtZ Good plan: https://explain.depesz.com/s/SJSt Any suggestions on how to make the planner make bet

Re: SV: bad plan using nested loops

2018-02-02 Thread Johan Fredriksson
tor 2018-02-01 klockan 20:34 + skrev Johan Fredriksson: > > Johan Fredriksson writes: > > > Bad plan: https://explain.depesz.com/s/avtZ > > > Good plan: https://explain.depesz.com/s/SJSt > > > Any suggestions on how to make the planner make better decisions > > > for > > > this query? > > > >

SV: bad plan using nested loops

2018-02-01 Thread Johan Fredriksson
> Johan Fredriksson writes: > > Bad plan: https://explain.depesz.com/s/avtZ > > Good plan: https://explain.depesz.com/s/SJSt > > Any suggestions on how to make the planner make better decisions for > > this query? > > Core of the problem looks to be the misestimation here: > >Index Only