pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Csaba Nagy <nagy@ecircle-ag.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Searching for the cause of a bad plan
Date: Fri, 21 Sep 2007 18:39:12 +0100
Message-ID: <1190396352.4202.109.camel@ebony.site> (raw)
In-Reply-To: <6175.1190390913@sss.pgh.pa.us>
References: <1190369024.4661.173.camel@PCD12478>
	<6175.1190390913@sss.pgh.pa.us>

On Fri, 2007-09-21 at 12:08 -0400, Tom Lane wrote:
> Csaba Nagy <nagy@ecircle-ag.com> writes:
> > Looking at Plan 2, it looks like the "limit" step is estimating wrongly
> > it's cost.
> 
> The reason you get a bad plan is that this rowcount estimate is so far
> off:

That's true, but its not relevant, since the query would still be fast
even if that estimate was exactly right. With LIMIT 10, it wouldn't
matter how many rows were there as long as there were more than 10. The
true execution cost is limited, the cost model is not.

-- 
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com




view thread (26+ messages)  latest in thread

Message-ID: <1190396352.4202.109.camel@ebony.site>
Permalink:  ../1190396352.4202.109.camel@ebony.site/
Also on:    postgresql.org/message-id/1190396352.4202.109.camel@ebony.site

 · 

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: simon@2ndquadrant.com, tgl@sss.pgh.pa.us, nagy@ecircle-ag.com
  Subject: Re: Searching for the cause of a bad plan
  In-Reply-To: <1190396352.4202.109.camel@ebony.site>

* 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