Re: BUG #5539: Generally incorrect planner estimations on join with UNION ALL - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5539: Generally incorrect planner estimations on join with UNION ALL
Date
Msg-id AANLkTik4k7fc0CcBRztUdVnrFGV3YD_OYT3WBa5Fe7gG@mail.gmail.com
Whole thread Raw
In response to BUG #5539: Generally incorrect planner estimations on join with UNION ALL  ("Maksym Boguk" <Maxim.Boguk@gmail.com>)
List pgsql-bugs
On Sat, Jul 3, 2010 at 8:47 PM, Maksym Boguk <Maxim.Boguk@gmail.com> wrote:
> notable planner had correctly estimated amount of rows in one side of the
> join:
> (Append =A0(cost=3D0.00..0.98 rows=3D2 width=3D4))
> and planner hard correctly estimated amount of rows in the another side of
> the join:
> Index Scan using t3_value_key on t3 =A0(cost=3D0.00..0.49 rows=3D1 width=
=3D8)
>
> And instead of use 2(from append)*1(from scan on t3)=3D2 as final row
> estimation, planner chooses use heuristic value 1000.

2 isn't necessarily correct, because the two rows on the outer side
needn't match the 1 row on the inner side - it could be less.

But I agree with you that the estimate of 1000 doesn't seem to make
much sense.  I'm not sure where that's coming from.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5548: ERROR: invalid attnum ## for rangetable entry on EXPLAIN VERBOSE, not on EXPLAIN
Next
From: Tom Lane
Date:
Subject: Re: BUG #5548: ERROR: invalid attnum ## for rangetable entry on EXPLAIN VERBOSE, not on EXPLAIN