SQL Server DELETE is slower with indexes

后端 未结 5 1648
忘掉有多难
忘掉有多难 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:03

    You can also try TSQL extension to DELETE syntax and check whether it improves performance:

    DELETE FROM big_table
    FROM big_table AS b
    INNER JOIN small_table AS s ON (s.id_product = b.id_product)
    WHERE s.id_category  =1
    

提交回复
热议问题