Re: help on a query

From: Greg Stark <gsstark(at)mit(dot)edu>
To: mmurrain(at)dbdes(dot)com
Cc: "Thomas F(dot)O'Connell" <tfo(at)sitening(dot)com>, CHRIS HOOVER <CHRIS(dot)HOOVER(at)companiongroup(dot)com>, sad(at)bankir(dot)ru, pgsql-sql(at)postgresql(dot)org
Subject: Re: help on a query
Date: 2004-10-09 03:17:38
Message-ID: 87sm8o4m25.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Michelle Murrain <tech(at)murrain(dot)net> writes:

> The OUTER JOIN version is quite a bit more efficient (by an order of magnitude)
> than the option with WHERE NOT EXISTS subquery.

This is going to be heavily dependent on the version of postgres. IN/NOT IN
execution has improved a lot in 7.4 and later. If you're still on 7.3 then the
outer join will be better. But in 7.4 I would actually expect the NOT IN or
the NOT EXISTS to be faster.

--
greg

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message C. Bensend 2004-10-09 03:37:33 Impact of foreign keys on a simple count(*) ?
Previous Message Michael Fuhr 2004-10-08 19:32:02 Re: Record Count