Re: Performance problems, bad estimates and plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Performance problems, bad estimates and plan
Date
Msg-id 9065.1118252356@sss.pgh.pa.us
Whole thread Raw
In response to Performance problems, bad estimates and plan  (Allan Wang <allanvv@gmail.com>)
List pgsql-performance
Allan Wang <allanvv@gmail.com> writes:
> On Wed, 2005-06-08 at 13:02 -0400, Tom Lane wrote:
>> Are you running 7.4.8 or 8.0.2 or later?

> I'm running 8.0.2 on Gentoo.

Oh, OK [ looks again ... ]  I read the join backward, the issue I was
concerned about would've applied to a right join there not left.

The seqscan vs indexscan difference is a red herring: if you look at the
explain output, the only thing that changes to an indexscan is the scan
on cities, which is only two rows and is not taking any time anyway.
The thing that is taking a long time (or not) is the indexscan over
players.  The planner is expecting that to stop short of completion
(presumably based on comparing the maximum values of playerid in
the two tables) --- and in one plan it does so, so the planner's
logic is apparently correct.

Are there any NULLs in c.playerid?  We found an executor issue recently
that it would not figure out it could stop the scan if there was a NULL
involved.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance problems, bad estimates and plan
Next
From: Tom Lane
Date:
Subject: Re: Performance problems, bad estimates and plan