Re: Understanding bad estimate (related to FKs?)

2020-10-29 Thread Tomas Vondra
On Thu, Oct 29, 2020 at 11:25:48AM -0400, Philip Semanchuk wrote: On Oct 28, 2020, at 9:13 PM, Justin Pryzby wrote: On Mon, Oct 26, 2020 at 11:20:01AM -0600, Michael Lewis wrote: On Mon, Oct 26, 2020 at 11:14 AM Philip Semanchuk wrote: The item I'm focused on is node 23. The estimate is

Re: Understanding bad estimate (related to FKs?)

2020-10-29 Thread Philip Semanchuk
> On Oct 28, 2020, at 9:13 PM, Justin Pryzby wrote: > > On Mon, Oct 26, 2020 at 11:20:01AM -0600, Michael Lewis wrote: >> On Mon, Oct 26, 2020 at 11:14 AM Philip Semanchuk >> wrote: >> > The item I'm focused on is node 23. The estimate is for 7 rows, actual >>> is 896 (multiplied by 106

Re: query plan using partial index expects a much larger number of rows than is possible

2020-10-29 Thread Michael Lewis
On Wed, Oct 28, 2020 at 5:30 PM Tom Lane wrote: > "Olivier Poquet" writes: > > Looking at it in more detail, I found that the planner is assuming that > I'll get millions of rows back even when I do a simple query that does an > index scan on my partial index: > > We don't look at partial-index

RE: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join

2020-10-29 Thread Ehrenreich, Sigrid
Thanks! Regards, Sigrid -Original Message- From: Magnus Hagander Sent: Thursday, October 29, 2020 10:57 AM To: Ehrenreich, Sigrid Cc: Tom Lane ; David Rowley ; pgsql-performance@lists.postgresql.org Subject: Re: Postgres Optimizer ignores information about foreign key relationship, s

Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join

2020-10-29 Thread Magnus Hagander
On Thu, Oct 29, 2020 at 9:43 AM Ehrenreich, Sigrid wrote: > > Hi Tom, > > Thanks a lot for your help! > > If it is in the HEAD, does it mean, it will be included in v14? Yes, that's precisely what it means. Unless someone finds something bad with it and it has to be removed of course, but in pri

RE: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join

2020-10-29 Thread Ehrenreich, Sigrid
Hi Tom, Thanks a lot for your help! If it is in the HEAD, does it mean, it will be included in v14? I'll have to see, if we dare building our own v13 version with the patch. (I would love to, because I am simply thrilled to pieces, having a patch made by you for us 😉) Regards, Sigrid -Ori