Re: Strange plan in pg 8.1.0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mattias Kregert <mattias(at)kregert(dot)se>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Strange plan in pg 8.1.0
Date: 2006-10-30 15:09:29
Message-ID: 16059.1162220969@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Mattias Kregert <mattias(at)kregert(dot)se> writes:
> Why does it come up with this strange plan?

Because 8.1 can't reorder outer joins. To devise the plan you want,
the planner has to be able to prove that it's OK to perform the IN join
before the LEFT join, something that isn't always the case. 8.2 can
prove this, but no existing release can.

The only workaround I can think of is to do the IN in a sub-select.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mattias Kregert 2006-10-30 15:38:13 Re: Strange plan in pg 8.1.0
Previous Message Luke Lonergan 2006-10-30 15:03:41 Re: Best COPY Performance