Re: [GENERAL] Negating the list of selected rows of a join - Mailing list pgsql-general

From Ulf Mehlig
Subject Re: [GENERAL] Negating the list of selected rows of a join
Date
Msg-id 199903140926.KAA02084@pandora3.uni-bremen.de
Whole thread Raw
In response to Negating the list of selected rows of a join  ("Manuel Lemos" <mlemos@acm.org>)
List pgsql-general
Clark Evans <clark.evans@manhattanproject.com>/Ulf Mehlig
<umehlig@pandora3.uni-bremen.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@zmt.uni-bremen.de>
              Center for Tropical Marine Ecology/ZMT, Bremen, Germany
----------------------------------------------------------------------

pgsql-general by date:

Previous
From: Clark Evans
Date:
Subject: Re: [GENERAL] Negating the list of selected rows of a join
Next
From: Henk Jan Barendregt
Date:
Subject: Error building pg 6.4 on RH Linux