Most Efficient (Fast) T-SQL DELETE For Many Rows?

前端 未结 8 1178
后悔当初
后悔当初 2020-12-16 06:31

Our server application receives information about rows to add to the database at a rate of 1000-2000 rows per second, all day long. There are two mutually-exclusive columns

8条回答
  •  醉梦人生
    2020-12-16 07:27

    Indexing:

    Consider using an indexed persisted computed column for longTag which stores a checksum of longTag. Instead of indexing 'LongTag1', you index a 4-byte int value (86939596).

    Then your look-ups are [hopefully*] faster, and you just have to include the longTag value in the query/delete. Your code would be slightly more complex, but the indexing is likely to be much more efficient.

    * Requires testing

提交回复
热议问题