Re: Strange behavior once statistics are there - Mailing list pgsql-performance

From Daniel Westermann (DWE)
Subject Re: Strange behavior once statistics are there
Date
Msg-id GV0P278MB0483B5849A03A3FBDCCFC7F5D24C9@GV0P278MB0483.CHEP278.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: Strange behavior once statistics are there  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, April 15, 2021 17:00
To: Daniel Westermann (DWE) <daniel.westermann@dbi-services.com>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: Strange behavior once statistics are there
 
>I'd suggest trying to flatten these to be regular joins, ie
>try to bring up persons6_ and stufen7_ into the main JOIN nest.
>It looks like persons6_.pes_id might be unique, meaning that you
>don't really need the IN behavior in the first case so flattening
>it should be straightforward.  The other one is visibly not unique,
>but since you're using "select distinct" at the top level anyway,
>getting duplicate rows might not be a problem (unless there are
>a lot of duplicates?)

Thank you, Tom


pgsql-performance by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Disabling options lowers the estimated cost of a query
Next
From: Tom Lane
Date:
Subject: Re: Disabling options lowers the estimated cost of a query