>Sergey,
>
>>You can also rewrite it as follow (it may be faster)
>>
SELECT taitem.ident;
>> FROM taitem;
>> WHERE code IN (SELECT arcode.code FROM arcode ;
>> WHERE arcode.activity = "EA")
>>
>
>I'm almost positive that an EXISTS select is going to be faster than an IN select. AFAIK exists allows the inner select to be run only once. IN forces it to be run for every row in the outer select.
Hi David,
It's actualy opposite. IN subquery runs once and than result is used by the main query. The EXISTS uses correlated subquery so it has to run for every record in the main query.
--sb--