Re: Query brings system dowh, needs help

From: John Jones <john_at_iluvatar.tip.duke.edu>
Date: Fri, 10 Mar 1995 08:25:10 -0500 (EST)
Message-ID: <Pine.NXT.3.90.950310082332.25472A-100000_at_iluvatar>


On 6 Mar 1995, Adam Hoffman wrote:

> In article <3j1osf$95b_at_access1.digex.net>, gmisrod_at_access.digex.net (gmisassoc) says:
> >
> >
> >I have two tables and I am running the following query:
> >
> >SELECT id FROM table1 WHERE id NOT IN
> >(SELECT id FROM table2)
> >
> >Both tables are about 20,000 records each. This query is
> >bringing a Sequent to its knees.
> >
> >What I want are all the ids that are in table1 but are not in table2.
> >
> >Any help is appreciated.
 

You can also use the MINUS statement. I did it yesterday and it really worked fast. Did the select like in your example and it ran for over an hour and still had not returned anything. Try the example below. It only took a couple of minutes to run.

select * from a
MINUS
select * from b; Received on Fri Mar 10 1995 - 14:25:10 CET

Original text of this message