Re: [GENERAL] Negating the list of selected rows of a join

From: Ulf Mehlig <umehlig(at)uni-bremen(dot)de>
To: umehlig(at)uni-bremen(dot)de
Cc: clark(dot)evans(at)manhattanproject(dot)com, mlemos(at)acm(dot)org, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Negating the list of selected rows of a join
Date: 1999-03-14 09:26:00
Message-ID: 199903140926.KAA02084@pandora3.uni-bremen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Clark Evans <clark(dot)evans(at)manhattanproject(dot)com>/Ulf Mehlig
<umehlig(at)pandora3(dot)uni-bremen(dot)de> wrote:

> > > Hope this will do the trick.
> >
> > Maybe not -- doesn't that mean, that the query won't return a
> > single row in case there is *any* pair of equal names in both
> > tables?!
>
> No. It's a correlated sub-query. It's actually much more efficient
> with large tables than the other approach (which has to put
> the entire result set of table_b on the heap before it can
> process table_a). Your approach is, however, much better (by a
> large factor) if table_a is very large and table_b is very small,
> since you don't have to hit the index for table_b on every
> row of table_a...

Yes, it *will* do the trick!! Sorry, Clark, I misinterpreted your
sub-query ... have to read more carefully ...

Thanks for your correction!
Ulf

--
======================================================================
Ulf Mehlig <umehlig(at)zmt(dot)uni-bremen(dot)de>
Center for Tropical Marine Ecology/ZMT, Bremen, Germany
----------------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Henk Jan Barendregt 1999-03-14 10:54:24 Error building pg 6.4 on RH Linux
Previous Message Clark Evans 1999-03-14 08:21:13 Re: [GENERAL] Negating the list of selected rows of a join