Re: Strange plan in pg 8.1.0

From: "Mattias Kregert" <mattias(at)kregert(dot)se>
To: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Strange plan in pg 8.1.0
Date: 2006-10-30 14:26:09
Message-ID: 003301c6fc2f$57e2c660$09000a0a@kregert.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> From: "Steinar H. Gunderson" <sgunderson(at)bigfoot(dot)com>
> On Mon, Oct 30, 2006 at 01:05:07PM +0200, Mattias Kregert wrote:
>> -> Hash Left Join (cost=59.66..206763.11 rows=1215336
>> width=27) (actual time=4.959..3228.550 rows=1216434 loops=1)
>> Hash Cond: (("outer".prislista = ("inner".listid)::text)
>> AND ("outer".tjanst = ("inner".tjanstid)::text))
>
> Note the conversion to text here. Are you sure the types are matching on
> both
> sides of the join?
>
> /* Steinar */

On the left side it is text, and on the right side it is varchar(10).
Casting left side to varchar(10) does not help, in fact it makes things even
worse: The cast to ::text vanishes in a puff of logic, but the plan gets
bigger and even slower (20-25 seconds).

A RIGHT join takes only 20 milliseconds, but i want the left join because
there could be missing rows in the "prislist" table...

/* m */

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Luke Lonergan 2006-10-30 15:03:41 Re: Best COPY Performance
Previous Message Luke Lonergan 2006-10-30 14:23:07 Re: Best COPY Performance