创建非聚集索引会破坏数据库 (SQL Server 2008) 上的更改跟踪吗?
我一直在调查我的数据库(SQL Server 2008)的一些性能问题。 SQL Management studio 建议我使用此代码添加非聚集索引,这将减少 90% 以上的处理时间。
USE [DatabaseName]
GO
CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[tblAnswers] ([QuestionID])
INCLUDE ([CallID],[Value])
GO
然而,我担心使用此代码会破坏数据库上的更改跟踪,这对于保持完整至关重要。
在另一个数据库上测试了代码,似乎没问题,结果是,下次我同步(从偶尔连接的客户端)时,尽管没有实际上传或下载任何额外数据,但处理时间却要长得多,后续同步恢复到正常速度。
这段代码可以安全运行吗?
I have been investigating some performance issues with my database (SQL Server 2008). SQL Management studio suggested that I use this code to add a nonclustered index which will decrease processing time by over 90%.
USE [DatabaseName]
GO
CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[tblAnswers] ([QuestionID])
INCLUDE ([CallID],[Value])
GO
I am however worried that using this code will break change tracking on my database which is essential to keep in tact.
Having tested the code an another database it seemed okay, the resulting consequence was that the next time i synchronized (from my occasionally connected client) it took much longer to process despite not actually uploading or downloading any extra data, subsequent synchronizations returned to usual speed.
Is this code safe to run?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于任何感兴趣的人,我在进行了更多测试后继续进行。
我设置 SQL Management studio 来通知我任何会导致表被删除/重新创建的操作。然后我运行了代码,一切都很好。没有表受到这种方式的影响,因此: -
更改跟踪保持完好。
唷。
For anyone interested, i went ahead after some more testing and bit the bullet.
I set SQL Management studio to inform me of any action that would cause tables to be dropped / recreated. I then ran the code and it was fine. No tables were affected in this way and so : -
change tracking remained in tact.
Phew.