Re: "SELECT .. WHERE NOT IN" query running for hours - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: "SELECT .. WHERE NOT IN" query running for hours
Date
Msg-id 4D2B19BE0200002500039215@gw.wicourts.gov
Whole thread Raw
In response to Re: "SELECT .. WHERE NOT IN" query running for hours  (Scott Carey <scott@richrelevance.com>)
Responses Re: "SELECT .. WHERE NOT IN" query running for hours  (Scott Carey <scott@richrelevance.com>)
List pgsql-performance
Scott Carey <scott@richrelevance.com> wrote:

> Often, the best query plans result from 'LEFT JOIN WHERE right
> side is NULL' rather than NOT EXISTS however.  I often get
> performance gains by switching NOT EXISTS queries to LEFT JOIN
> form.

Even in 8.4 and later?  I would think that the anti-join that Tom
added in 8.4 would always perform at least as well as the LEFT JOIN
technique you describe.

-Kevin

pgsql-performance by date:

Previous
From: Scott Carey
Date:
Subject: Re: "SELECT .. WHERE NOT IN" query running for hours
Next
From: Scott Carey
Date:
Subject: Re: "SELECT .. WHERE NOT IN" query running for hours