最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

如何使用 Sync Framework 同步使用大部分相同数据重新创建的表?

网站源码admin487浏览0评论
本文介绍了如何使用 Sync Framework 同步使用大部分相同数据重新创建的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我已经做了一个程序,它使用 Sync Framework 将一些表从 Azure 同步到 OnPremise(本地服务器).我按照这个例子制作了程序:如何:配置和执行与 SQL Azure 的同步.

I already did a program that uses Sync Framework to sync some tables from Azure to OnPremise (Local Server). I made the program following this example: How to: Configure and Execute Synchronization with SQL Azure.

对于他的更改是新行的表,它的工作速度令人难以置信.新行同步完美.第一次同步需要几个小时,但现在所有同步都需要几秒钟.

It works incredible fast with tables that his changes are new rows. The new rows are sync perfect. The first sync takes hours but now all the syncs take seconds.

但是我们还有其他表被删除并使用几乎相同的数据重新创建(99% 是旧数据,1% 是新数据).更新这些表的程序:删除所有数据并重新添加所有数据(包括新的).

But we have other tables that are deleted and recreated with mostly the same data (99% is the old and 1% is new data). The program that updates these tables: deleted all the data and add all again (including the new).

在这种情况下,我们的同步程序看到所有表都发生了变化.它可怕的缓慢.所有同步(第一次、第二次、第三次……)都需要几个小时.

In this situation our sync program see as ALL the tables changed. Its terrible slow. All the sync (the first, the second, the third..) takes hours.

可以修复吗?

谢谢,

推荐答案

我假设您只是删除行并重新插入,因为如果您实际上是删除表,那么您已经破坏了更改跟踪,因为更改跟踪会触发会和桌子一起丢掉.

am assuming you're simply deleting the rows and reinserting because if you're actually dropping the tables, you would have broken change tracking already because the change tracking triggers would have been dropped with the table.

如果您重新插入行,则触发器会将跟踪表中的相应行标记为已更改.同步时,即使您之前已经同步过这些行,也会同步它们.由于行已存在于目标上,因此会遇到冲突,从而减慢速度.如果您有 100 万行,那就有 100 万个冲突需要解决.

If you're reinserting the rows, then the triggers are marking the corresponding rows in the tracking tables as changed. When you sync, the rows are synched even if you've already sync them before. Since the rows already exists on the destination, it runs into conflicts which slows it down. If you have 1 million rows, that's one million conflicts that needs to be resolved.

这篇关于如何使用 Sync Framework 同步使用大部分相同数据重新创建的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

发布评论

评论列表(0)

  1. 暂无评论