Re: Weird NOT IN effect with NULL values - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: Weird NOT IN effect with NULL values
Date
Msg-id 200103012046.PAA19437@candle.pha.pa.us
Whole thread Raw
In response to Re: Weird NOT IN effect with NULL values  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
> SELECT name
> FROM customer
> WHERE NOT EXISTS (
> SELECT customer_id
> FROM salesorder
> WHERE customer_id = customer.customer_id
> );
> 
> Bruce, you may want to consider editing your next edition to include the
> above modification.  WHERE ... NOT IN is a bad idea for any subselect on
> medium-large tables.

FAQ item mentions this, and section 8.2 shows eqivalency at the end of
the section.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Weird NOT IN effect with NULL values
Next
From: "Martin A. Marques"
Date:
Subject: Re: why the DB file size does not reduce when 'delete' the data in DB?