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

前端 未结 13 576
遇见更好的自我
遇见更好的自我 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:06

    This was the old technique in SQL 2000 , partitioned views and remains a valid option for SQL 2005. The problem does come in from having large quantity of tables and the maintenance overheads associated with them.

    As you say, partitioning is an enterprise feature, but is designed for this large scale data removal / rolling window effect.

    One other option would be running batched deletes to avoid creating 1 very large transaction, creating hundreds of far smaller transactions, to avoid lock escalations and keep each transaction small.

提交回复
热议问题