RE: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join - Mailing list pgsql-performance

From Ehrenreich, Sigrid
Subject RE: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join
Date
Msg-id AM6PR02MB52874F338C07A45CAD07847AAB140@AM6PR02MB5287.eurprd02.prod.outlook.com
Whole thread Raw
In response to Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join  (Magnus Hagander <magnus@hagander.net>)
List pgsql-performance
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

-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us> 
Sent: Wednesday, October 28, 2020 5:55 PM
To: Ehrenreich, Sigrid <Ehrenreich@consist.de>
Cc: David Rowley <dgrowleyml@gmail.com>; pgsql-performance@lists.postgresql.org
Subject: Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of
returnedrows in join
 

"Ehrenreich, Sigrid" <Ehrenreich@consist.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

pgsql-performance by date:

Previous
From: "Olivier Poquet"
Date:
Subject: Re: query plan using partial index expects a much larger number of rows than is possible
Next
From: Magnus Hagander
Date:
Subject: Re: Postgres Optimizer ignores information about foreign key relationship, severly misestimating number of returned rows in join