MS SQL server。 如果有个表经常要大量加入数据,大量删除数据, 是不是应该把删除的记录做个删除标记,然后每个 月做一次真正的数据删除? 还是应该有别的更好的办法?
I*e
2 楼
depending on whether ms is doing deferred delete. most dbms are doing it.
x*e
3 楼
delete is faster than mark to be deleted(update) it really depends on how much data total and how much data need to be deleted and idnex. if you have some more detail, maybe we can take a look.
what is your concern? speed, impact of production server? if you don't need to keep the operation in tranlog, use truncate to make it run faster. and make sure you don't have clustered index if you don't need them