我最近接手了一个项目,他们有一个sql作业设置,每三个小时运行一次,重建ASP.NET成员资格数据库表中的索引.
这似乎相当高,每天重建索引8次.我每天大约有2000个新用户,总共约有200万注册用户.
对于正确的索引重建计划,您会建议什么?
解决方法
你的死锁肯定与重建索引有关.毫无疑问,这些索引不需要经常重建.至少应该考虑使用ONLINE选项,如果你可以在重建之前保持索引被删除.
这是我们使用的指南:
Index should be rebuilt when index
fragmentation is greater than 40%. Index
should be reorganized when index
fragmentation is between 10% to 40%.
Index rebuilding process uses more cpu
and it locks the database resources.
sql Server development version and
Enterprise version has option ONLINE,
which can be turned on when Index is
rebuilt. ONLINE option will keep index
available during the rebuilding.