碎片整理对复制来说很困难吗?

发布于 2024-08-28 04:33:53 字数 97 浏览 15 评论 0原文

有人告诉我,碎片整理会导致日志急剧增长。这是真的吗?如果是这样,有什么比碎片整理更好的方法,不会对日志产生太大影响?我们正在两个站点之间运行 SQL Server 2005 复制。

I've been told that defragging causes the log to grow tremendously. Is this true? If so, is there something better to do than defragging that will not impact the log as much? We are running SQL Server 2005 replicating between 2 sites.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

流绪微梦 2024-09-04 04:33:53

SQL Server 中没有“碎片整理”。您可能正在谈论索引重组操作或索引重建操作。重组对日志的影响很小,但索引重建会创建与索引大小乘以一个因子一样多的日志。对于大型索引,重建操作可能会导致日志增长。

拥有较大的日志将影响事务日志读取器代理,因为它将在一段时间内有更多的日志记录需要扫描。最终日志读取器代理会赶上。确切的数字(延迟时间、延迟大小等)会因多种因素而有所不同,您最好的选择是尝试和测量。

至于替代方案:

  • 您是否测量了索引碎片系数?
  • 您是否有证据表明性能受到碎片的影响?许多负载并不关心碎片。
  • 您是否分析过架构设计导致碎片化的根本原因?

如果答案是“是”、“是”和“是”,并且结论是定期索引重建是不可避免的,那么就没有其他选择,您将不得不硬着头皮在校准硬件要求时考虑此操作。

There is no 'defrag' in SQL Server. You may be talking about an index reorganize operation or an index rebuild operation. Reorganize is light on log, but index rebuild creates as much log as the size of the index multiplied by a factor. For a large index the rebuild operation may result in log growth.

Having a large log will impact the transactional log reader agent simply because it will have more log records to scan through for a period. Eventually the log reader agent will catch up. The exact numbers (duration of latency, latency size etc) will differ based on a number of factors, your best choice is trial and measurement.

As for alternatives:

  • Did you measure the index fragmentation factor?
  • Do you have evidence that performance is affected by fragmentation? Many loads don't care about fragmentation.
  • Did you analyze the root cause of schema design that leads fragmentation?

If the answers are Yes, Yes and Yes and the conclusion is that periodic index rebuild is unavoidable then there is no alternative, you're going to have to bite the bullet and take this operation into account when calibrating the hardware requirements.

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