Re: DELETING 100 million from a table weekly SQl SERVER 2000



"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
--


.



Relevant Pages

  • Re: Sense lining--2nd try
    ... you have to break a clause, keep the subject and predicate together. ... I've never taken a speed reading course. ... I've worked on a lot of PowerPoint presentations, because I was required to do so for a job. ...
    (comp.fonts)
  • Re: Sublists question
    ... Since any of the variables can be s, this clause is certainly true. ... Here is an alternative predicate that does not have that problem. ... What Prolog are you using? ... Anyway, with the new sublist/2 predicate, the query, langford, ...
    (comp.lang.prolog)
  • case of predicates
    ... Quite often a COND is simply a series of predicates all ... finding the first predicate that is true of the original value. ... (if (eq t (car clause)) ... `((,(car clause),var) ...
    (comp.lang.lisp)
  • Re: Search path program
    ... predicate is specified, EQL is used. ... the test-key is eql to any key for that clause", ... specifically mentioned the predicate. ... programmers would be designed like a well-written computer program. ...
    (comp.lang.lisp)
  • Re: Oracle Outer Joining - Unexpected Result Sets
    ... extract for business users on a nightly basis. ... the above query predicate should ... removed the condition is part of the where clause. ... the condition when doing an outer join. ...
    (comp.databases.oracle.server)