Re: SELECT subquery much slower than IN ( list...)???
Posted in 1998
On Thu, 5 Mar 1998 22:00:41 +0000, David Williams
<djw@smooth1.demon.co.uk> wrote:
>In article <01bd47f3$ab35d9a0$55392bd1@reprogle>, Matt Reprogle
><reprogle@iquest.net> writes
>>I have been having problems with a select statement of the type:
>>
>>select col1, col2
>>from bigtable
>>where col1 in
>> (select key from temp_list_table);
(stuff clipped)
> i.e. do a join not a corelated subquery!!
True, if the 'key' in the temp table has no duplicates
then just join; if there are duplicates, you can
'select unique key' from the temp table into another
temp table, but I dont think this is a corelated
subquery, just a subquery. A corelated subquery
would be something like
select col1, col2
from bigtable
where col1 in
(select col1 from temp_list_table
where temp_list_table.col2=bigtable.col2);
Cheers,
Douglas Wilson