徵狀
假設您在使用 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。如果您遇到這個問題,您會注意到下列插入/選取獨特的合併展開程式語句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 產品確實有上述問題。