Re: DELETING 100 million from a table weekly SQl SERVER 2000
- From: "Adam Machanic" <amachanic@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 5 Nov 2005 14:51:36 -0500
"harish" <harish.prabhala@xxxxxxxxx> wrote in message
news:1131217180.922372.211460@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> Thanks. We have an index on four columns in this table. For Ex A, B, C
> and D
> The delete statement's where clause has the conditions for A, B and C
> The delete statement's where clause has the conditions for just A
>
>
> Which of the two's performance will be faster?
There should be virtually no difference. What might be faster would be
using a predicate that can be satisfied by the clustered index, to avoid
doing two lookups.
> 1) Does this setting ROWCOUNT first sort the table and then delete?
No; it just deletes the first N rows it finds that satisfy the
predicate.
> 2) The above query is executed to delete all records satisfying the
> condition in steps of 5000 until the delete is comple.
> How can I stop it after one 5000?
Remove the loop.
--
Adam Machanic
Pro SQL Server 2005, available now
www.apress.com/book/bookDisplay.html?bID=457
--
.
- References:
- Re: DELETING 100 million from a table weekly SQl SERVER 2000
- From: Tibor Karaszi
- Re: DELETING 100 million from a table weekly SQl SERVER 2000
- From: harish
- Re: DELETING 100 million from a table weekly SQl SERVER 2000
- Prev by Date: Re: DELETING 100 million from a table weekly SQl SERVER 2000
- Next by Date: Re: Problem with Dates and OpenXML command
- Previous by thread: Re: DELETING 100 million from a table weekly SQl SERVER 2000
- Next by thread: Re: DELETING 100 million from a table weekly SQl SERVER 2000
- Index(es):
Relevant Pages
|