SQL Server Efficiently dropping a group of rows with millions and millions of rows

前端 未结 13 703
遇见更好的自我
遇见更好的自我 2021-02-04 12:26

I recently asked this question: MS SQL share identity seed amongst tables (Many people wondered why)

I have the following layout of a table:

Table: Star

13条回答
  •  自闭症患者
    2021-02-04 13:32

    Must you delete them? Often it is better to just set an IsDeleted bit column to 1, and then do the actual deletion asynchronously during off hours.

    Edit:

    This is a shot in the dark, but adding a clustered index on CategoryId may speed up deletes. It may also impact other queries adversely. Is this something you can test?

提交回复
热议问题