症状
假设你在使用 Microsoft SQL Server 2012 或 Microsoft SQL Server 2014 中的参数化和联接筛选器的合并复制中使用 precomputed 分区。 当你尝试在筛选器的根处使用表中的 INSERT 语句(在 Publisher 端)时,可能会在 插入时遇到性能降低的性能。
解决方案
应用此修补程序后,必须在已发布的数据库上手动执行 sp_vupgrade_mergeobjects 过程。 它可以帮助重新生成特定于文章的触发器、存储过程和视图,用于跟踪和应用合并复制的数据更改。在 SQL Server 的以下累积更新中,此问题首先已修复。
SQL Server 2014 累积更新5 /en-us/help/3011055
SQL Server 2012 SP2 的累积更新3 /en-us/help/3002049
SQL Server 的每个新的累积更新均包含以前的累积更新中包含的所有修补程序和所有安全修补程序。 查看 SQL Server 的最新累积更新:
更多信息
插入<表>触发器合并插入触发器MSmerge_ins_XXXX,并且触发器调用过程MSmerge_expand_sp_XXXX。如果你遇到此问题,你将注意到以下的Insert/Select Distinct语句MSmerge_expand_sp_XXXX会占用大量时间。 在这种情况下,插入的性能将减少。
insert into dbo.MSmerge_current_partition_mappings with (rowlock) (publication_number, tablenick, rowguid, partition_id) select distinct 1, mc.tablenick, mc.rowguid, v.partition_id from dbo.MSmerge_contents mc with (rowlock) JOIN dbo.[MSmerge_dynamic_filter_merge_new_settings_PARTITION_VIEW] v with (rowlock) ON mc.tablenick = <tablenick> and mc.rowguid = v.[rowguid] and mc.marker = @child_marker and v.partition_id in (select partition_id from dbo.MSmerge_current_partition_mappings cpm with (rowlock) JOIN dbo.MSmerge_contents mc2 with (rowlock) ON cpm.rowguid = mc2.rowguid and mc2.marker = @marker) where not exists (select * from MSmerge_current_partition_mappings with (readcommitted, rowlock, readpast) where publication_number = 1 and tablenick = <tablenick> and rowguid = v.[rowguid] and partition_id = v.partition_id)
状态
Microsoft 已确认这是在“适用范围”部分中列出的 Microsoft 产品存在的问题。