Re: BUG #15160: planner overestimates number of rows in join when there are more than 200 rows coming from CTE - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15160: planner overestimates number of rows in join when there are more than 200 rows coming from CTE
Date
Msg-id 15035.1523974538@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15160: planner overestimates number of rows in join when thereare more than 200 rows coming from CTE  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15160: planner overestimates number of rows in join whenthere are more than 200 rows coming from CTE
List pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> I'm wondering how planner estimates number of rows in that case:

See eqjoinsel_semi, particularly the change in behavior when it thinks
nd2 is or is not a default estimate.

Given the lack of statistics about the output of the WITH clause,
it's hard to see how we'd ever get trustworthy estimates here.
I think the fact that your first example yields an accurate
estimate is mostly luck.

            regards, tom lane


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15161: libpq - Invalid SSPI context after PQreset
Next
From: Emre Hasegeli
Date:
Subject: Re: Standby corruption after master is restarted