Re: Optimizing NOT IN plans / verify rewrite

From: Andres Freund <andres(at)anarazel(dot)de>
To: Maciek Sakrejda <msakrejda(at)truviso(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizing NOT IN plans / verify rewrite
Date: 2010-08-02 22:19:00
Message-ID: 20100802221900.GC2892@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Aug 02, 2010 at 01:35:13PM -0700, Maciek Sakrejda wrote:
> >> All fields involved are declared NOT NULL, but thanks for the heads up.
> >Afair the planner doesnt use that atm.
>
> I was referring to not having to care about the strange NULL semantics
> (as per your original comment), since I have no NULLs. Given that, I
> think the NOT EXISTS could be a good solution, even on 8.3 (we're
> planning to upgrade, but it's not a feasible solution to this
> particular problem), no?
The point is that only 8.4 will optimize that case properly. 8.3 will
generate plans which are inefficient in many (or most) cases for both
variants. I would suggest to use manual antijoins...

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2010-08-02 22:21:41 Re: Testing Sandforce SSD
Previous Message Kevin Grittner 2010-08-02 21:38:21 Re: Optimizing NOT IN plans / verify rewrite