Skip site navigation (1) Skip section navigation (2)

Re: Searching for the cause of a bad plan

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Searching for the cause of a bad plan
Date: 2007-09-21 17:39:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Fri, 2007-09-21 at 12:08 -0400, Tom Lane wrote:
> Csaba Nagy <nagy(at)ecircle-ag(dot)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

In response to


pgsql-performance by date

Next:From: Simon RiggsDate: 2007-09-21 17:49:33
Subject: Re: Query planner unaware of possibly best plan
Previous:From: brauagustin-suscDate: 2007-09-21 17:30:45
Subject: Re: Low CPU Usage

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group