创建非聚集索引会破坏数据库 (SQL Server 2008) 上的更改跟踪吗?

发布于 2024-08-11 15:47:59 字数 440 浏览 5 评论 0原文

我一直在调查我的数据库(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

草莓味的萝莉 2024-08-18 15:47:59

对于任何感兴趣的人,我在进行了更多测试后继续进行。

我设置 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文