Re: Unreasonable long SQL statement execution
From: Erik Dahl <Dahl#m#_Erik_D_at_msmail.aai.arco.com>
Date: Wed, 23 Nov 1994 00:14:52 GMT
Message-ID: <Czp20u.67t_at_news.arco.com>
Date: Wed, 23 Nov 1994 00:14:52 GMT
Message-ID: <Czp20u.67t_at_news.arco.com>
In article <stanbCzMzFH.F5q_at_netcom.com> Stan Brown, stanb_at_netcom.com
writes:
[...]
> Then it deletes one at a time from the subsidiary tables using
> a sql statement like:
>
> DELETE from table where key in
> (select key from temp_table)
> (this work fine)
>
> The it attempts to do the same thing on the master table.
> (this takes several orders of magnitude longer)
[...]
Have you tried doing the delete as an EXISTS test? ie.,
DELETE from table where EXISTS (SELECT key from temp)
I've found this to be faster in some cases.
*---------------------------------->>><<<------------------------------* * Erik Dahl >< ARCO Alaska, Inc. * * E-Mail - lasedd_at_aai.arco.com >< ANO-963E (907) 263-4461 * * Compuserve - 72754,1315 >< Opinions expressed are my own * *---------------------------------->>><<<------------------------------*Received on Wed Nov 23 1994 - 01:14:52 CET