Re: Non Matching Records in Two Tables - Mailing list pgsql-sql

From chester c young
Subject Re: Non Matching Records in Two Tables
Date
Msg-id 20060214210829.79695.qmail@web54302.mail.yahoo.com
Whole thread Raw
In response to Re: Non Matching Records in Two Tables  (Ken Hill <ken@scottshill.com>)
Responses Re: Non Matching Records in Two Tables  (Ken Hill <ken@scottshill.com>)
List pgsql-sql
> Here is my query SQL:
> 
> SELECT key100 FROM ncccr10
> WHERE ncccr10.key100 NOT IN (SELECT key100 FROM ncccr9);
> 
> It is is running after 30 minutes. Here is the query plan:
>

I would try an outer join:

select a.key100
from ncccr10 a
left join ncccr9 b on( key100 )
where b.key100 is null;

also (hate to be obvious) have you analyzed lately?


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Non Matching Records in Two Tables
Next
From: Maciej Piekielniak
Date:
Subject: create table and data types