Re: "SELECT .. WHERE NOT IN" query running for hours

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "??????? ????????" <lebiathan(at)gmail(dot)com>, "Scott Carey" <scott(at)richrelevance(dot)com>, "Mladen Gogala" <mladen(dot)gogala(at)vmsinfo(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: "SELECT .. WHERE NOT IN" query running for hours
Date: 2011-01-10 20:37:50
Message-ID: 4D2B19BE0200002500039215@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Scott Carey <scott(at)richrelevance(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2011-01-10 21:05:04 Re: "SELECT .. WHERE NOT IN" query running for hours
Previous Message Scott Carey 2011-01-10 20:24:10 Re: "SELECT .. WHERE NOT IN" query running for hours