pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory Stark <stark@enterprisedb.com>
To: Scott Carey <scott@richrelevance.com>
Cc: pgsql-performance\@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Query planner cost estimate less than the sum of its parts?
Date: Wed, 05 Nov 2008 21:22:09 +0000
Message-ID: <877i7hc1ha.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <a1ec7d000811051200m64561fd9l5a10983d4d40f097@mail.gmail.com>
References: <a1ec7d000811051200m64561fd9l5a10983d4d40f097@mail.gmail.com>


"Scott Carey" <scott@richrelevance.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!



view thread (3+ messages)  latest in thread

Message-ID: <877i7hc1ha.fsf@oxford.xeocode.com>
Permalink:  ../877i7hc1ha.fsf@oxford.xeocode.com/
Also on:    postgresql.org/message-id/877i7hc1ha.fsf@oxford.xeocode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: stark@enterprisedb.com, scott@richrelevance.com
  Subject: Re: Query planner cost estimate less than the sum of its parts?
  In-Reply-To: <877i7hc1ha.fsf@oxford.xeocode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox