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.
In response to
pgsql-sql by date
|Next:||From: C. Bensend||Date: 2004-10-09 03:37:33|
|Subject: Impact of foreign keys on a simple count(*) ?|
|Previous:||From: Michael Fuhr||Date: 2004-10-08 19:32:02|
|Subject: Re: Record Count|