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

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Ehrenreich, Sigrid" <Ehrenreich(at)consist(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join
Date: 2020-10-29 09:57:16
Message-ID: CABUevEz8zRzkeznCc6ovSLMDhsXtcmB+Ev72wJrdPJ82BMMCfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Oct 29, 2020 at 9:43 AM Ehrenreich, Sigrid
<Ehrenreich(at)consist(dot)de> 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 principle it
means that it will be in 14.

//Magnus

>
>
> 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
>
> -----Original Message-----
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> Sent: Wednesday, October 28, 2020 5:55 PM
> To: Ehrenreich, Sigrid <Ehrenreich(at)consist(dot)de>
> Cc: David Rowley <dgrowleyml(at)gmail(dot)com>; pgsql-performance(at)lists(dot)postgresql(dot)org
> Subject: Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join
>
> "Ehrenreich, Sigrid" <Ehrenreich(at)consist(dot)de> writes:
> > A patch would be very much appreciated.
> > We are currently running on Version 12, but could upgrade to 13, if necessary.
> > Could you send me a notification if you managed to program a patch for that?
>
> I've pushed a patch for this to HEAD, but current thinking is that we
> will not be back-patching it. Still, if you're desperate you could
> consider running a custom build of v13 with that patch --- a quick
> check suggests that it would back-patch easily. v12 would be a
> slightly harder lift (I see one hunk doesn't apply) but probably
> not by much.
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=ad1c36b0709e47cdb3cc4abd6c939fe64279b63f
>
> regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ehrenreich, Sigrid 2020-10-29 12:12:09 RE: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join
Previous Message Ehrenreich, Sigrid 2020-10-29 06:31:50 RE: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join