Posted by hallpa1@yahoo.com on 03/21/06 22:26
Hi All,
I am trying to delete rows from a table using a SQL statement similar
to this:
DELETE FROM TableA where ID1 IN
(Select ID1 From TableB where ID2>= @min and ID2<=@max)
Basically I want to delete all rows from TableA that have an ID in a
range in TableB. This is done in a stored proc.
When I look at the execution plan, it is using the indexes as I would
hope for. The problem is that it is doing a sort which accounts for
73% of the cost. I do not need to sort the results. I don't care what
order they are deleted in.
How can I prevent the sort from occuring? I need this delete to occur
as fast as possible.
Thanks In Advance
[Back to original message]
|