David Rowley writes:
> On Tue, 27 Oct 2020 at 06:54, Ehrenreich, Sigrid
> wrote:
>> -> Hash Join (cost=226.27..423.82 rows=115 width=0) (actual
>> time=3.150..7.511 rows=3344 loops=1) <=== With the FK, the
>> estimation should be 3344, but it is 115 rows
> I'd have expected this t
On Tue, 27 Oct 2020 at 06:54, Ehrenreich, Sigrid wrote:
> -> Hash Join (cost=226.27..423.82 rows=115 width=0) (actual
> time=3.150..7.511 rows=3344 loops=1) <=== With the FK, the
> estimation should be 3344, but it is 115 rows
I'd have expected this to find the foreign key and hav
On Mon, Oct 26, 2020 at 03:58:05PM +, Ehrenreich, Sigrid wrote:
> Hi Performance Guys,
>
> I hope you can help me. I am joining two tables, that have a foreign key
> relationship. So I expect the optimizer to estimate the number of the
> resulting rows to be the same as the number of the ret
> On Oct 26, 2020, at 1:20 PM, Michael Lewis wrote:
>
> On Mon, Oct 26, 2020 at 11:14 AM Philip Semanchuk
> wrote:
> >> The item I'm focused on is node 23. The estimate is for 7 rows, actual is
> >> 896 (multiplied by 1062 loops). I'm confused about two things in this node.
> >>
> >> The f
Hi Performance Guys,
I hope you can help me. I am joining two tables, that have a foreign key
relationship. So I expect the optimizer to estimate the number of the resulting
rows to be the same as the number of the returned rows of one of the tables.
But the estimate is way too low.
I have bui
On Mon, Oct 26, 2020 at 11:14 AM Philip Semanchuk <
phi...@americanefficient.com> wrote:
> >> The item I'm focused on is node 23. The estimate is for 7 rows, actual
> is 896 (multiplied by 1062 loops). I'm confused about two things in this
> node.
> >>
> >> The first is Postgres' estimate. The con
> On Oct 26, 2020, at 1:04 PM, Justin Pryzby wrote:
>
> On Mon, Oct 26, 2020 at 12:50:38PM -0400, Philip Semanchuk wrote:
>> I'm trying to understand a bad estimate by the planner, and what I can do
>> about it. The anonymized plan is here: https://explain.depesz.com/s/0MDz
>
> What postgres
On Mon, Oct 26, 2020 at 12:50:38PM -0400, Philip Semanchuk wrote:
> I'm trying to understand a bad estimate by the planner, and what I can do
> about it. The anonymized plan is here: https://explain.depesz.com/s/0MDz
What postgres version ?
Since 9.6(?) FKs affect estimates.
> The item I'm focus
I'm trying to understand a bad estimate by the planner, and what I can do about
it. The anonymized plan is here: https://explain.depesz.com/s/0MDz
The item I'm focused on is node 23. The estimate is for 7 rows, actual is 896
(multiplied by 1062 loops). I'm confused about two things in this node.