You are here: Unwanted Sort « MsSQL Server « IT news, forums, messages
Unwanted Sort

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация