SQL Server DELETE is slower with indexes

后端 未结 5 1623
忘掉有多难
忘掉有多难 2021-01-02 20:21

I have an SQL Server 2005 database, and I tried putting indexes on the appropriate fields in order to speed up the DELETE of records from a table with millions

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 21:21

    Indexes make lookups faster - like the index at the back of a book.

    Operations that change the data (like a DELETE) are slower, as they involve manipulating the indexes. Consider the same index at the back of the book. You have more work to do if you add, remove or change pages because you have to also update the index.

提交回复
热议问题