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

Re: Searching for the cause of a bad plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
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:53:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> On Fri, 2007-09-21 at 12:08 -0400, Tom Lane wrote:
>> The reason you get a bad plan is that this rowcount estimate is so far
>> off:

> That's true, but its not relevant,

Yes it is --- the reason it wants to use a hashjoin instead of a
nestloop is exactly that it thinks the loop would iterate too many
times.  (Ten is already too many in this case --- if it had estimated
five rows out of the join, it'd have gone with the nestloop, since
the cost estimate difference at the top level is less than 2x.)

			regards, tom lane

In response to


pgsql-performance by date

Next:From: brauagustin-suscDate: 2007-09-21 18:20:30
Subject: Re: Low CPU Usage
Previous:From: brauagustin-suscDate: 2007-09-21 17:51:57
Subject: Re: Low CPU Usage

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