Re: How can I make it faster? Help needed.

From: Mike Langholz <langholz_at_neomagic.com>
Date: Tue, 20 Apr 1999 09:23:36 -0700
Message-ID: <371CAA08.A6946228_at_neomagic.com>


How about...

SELECT DISTINCT m.cust_no
FROM message m
MINUS
SELECT DISTINCT c.cust_no
FROM customer c;

...seems to work well (<5 seconds) on multiple 100K row tables.

Good Luck.

mike.

"Dr. Wei Ho" wrote:
>
> Hi,
>
> Can anybody out there help me to make the following query faster.
>
> Both tables, MESSAGE and CUSTOMER, in the query have about 13,000
> records. In both tables, the fields CUST_NO are indexed.
>
> SELECT m.cust_no
> FROM message m
> WHERE m.cust_no
> NOT IN (SELECT c.cust_no FROM customer c);
>
> Thanks
>
> Wei

-- 
/------------*------------\
| Michael Langholz        |
* NeoMagic Corporation    *
| langholz_at_neomagic.com   |
\------------*------------/
Received on Tue Apr 20 1999 - 18:23:36 CEST

Original text of this message