Re: How can I tune this query?????

From: Bryon Cho <bryon.cho_at_intelsat.int>
Date: 1996/03/27
Message-ID: <4jc2s6$ccj_at_intelsat2.intelsat.int>#1/1


aboyes_at_nwu.edu (Andrea J Boyes) wrote:

>When I change the "=" to ">",
>select id from cat
>where keyval in
>(select keyval from dates
>where year > 1965);
>
>the query takes 2 minutes.
>
>Andrea J Boyes
>Northwestern University, Evanston, IL. USA
>aboyes_at_nwu.edu

wouldn't this work?

select c.id
from cat c, dates d
where c.keyval = d.keyval
and d.year > 1965

if you have indexes on cat and dates for keyval this should work much faster.

Bryon Cho

-- 
INTELSAT
Received on Wed Mar 27 1996 - 00:00:00 CET

Original text of this message