pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chester c young <chestercyoung@yahoo.com>
To: ken@scottshill.com
To: pgsql-sql@postgresql.org
Subject: Re: Non Matching Records in Two Tables
Date: Tue, 14 Feb 2006 13:08:29 -0800 (PST)
Message-ID: <20060214210829.79695.qmail@web54302.mail.yahoo.com> (raw)
In-Reply-To: <1139950507.3083.64.camel@localhost.localdomain>


> 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 



view thread (15+ messages)  latest in thread

Message-ID: <20060214210829.79695.qmail@web54302.mail.yahoo.com>
Permalink:  ../20060214210829.79695.qmail@web54302.mail.yahoo.com/
Also on:    postgresql.org/message-id/20060214210829.79695.qmail@web54302.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chestercyoung@yahoo.com, ken@scottshill.com
  Subject: Re: Non Matching Records in Two Tables
  In-Reply-To: <20060214210829.79695.qmail@web54302.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox