Re: Query planner cost estimate less than the sum of its parts?

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Scott Carey" <scott(at)richrelevance(dot)com>
Cc: "pgsql-performance\(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Query planner cost estimate less than the sum of its parts?
Date: 2008-11-05 21:22:09
Message-ID: 877i7hc1ha.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


"Scott Carey" <scott(at)richrelevance(dot)com> writes:

> Certainly, a cost estimate that is ... LESS than one of the sub sections of
> the query is wrong. This was one hell of a broken query, but it at least
> should have taken an approach that was not a nested loop, and I'm curious if
> that choice was due to a bad estimate here.
>
> Nested Loop IN Join (cost=0.00..3850831.86 rows=128266 width=8)

Because it's an IN join it doesn't have to run the inner join to completion.
Once it finds a match it can return the outer tuple and continue to the next
outer tuple.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's 24x7 Postgres support!

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2008-11-05 22:19:32 Re: Query planner cost estimate less than the sum of its parts?
Previous Message Greg Smith 2008-11-05 20:44:42 Re: lru_multiplier and backend page write-outs