日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

SQL Server Transactional Replication 中的 CommitBatchSize 和 CommitBatchThreshold 属性

發布時間:2023/12/20 数据库 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SQL Server Transactional Replication 中的 CommitBatchSize 和 CommitBatchThreshold 属性 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
最近遇到一個在SQL Server transactional replication 里關于CommitBatchSize 和CommitBatchThreshold設置的問題,BOL里面的解釋很含糊:

  • CommitBatchSize “Is the number of transactions to be issued to the Subscriber before a COMMIT statement is issued. The default is 100.”
  • CommitBatchThreshold “Is the number of replication commands to be issued to the Subscriber before a COMMIT statement is issued. The default is 1000.”
有一個老外做了詳細的測試結果總結了關于這兩個屬性的作用,詳情見:
http://kendalvandyke.blogspot.com/2008/11/how-commitbatchsize-and.html

根據我自己的分析,這兩個屬性的作用如下:

  • Distrabution Agent 將所有單條命令作為一個單位,CommitBatchThreshold和CommitBatchSize 是以單條命令數為標準
  • 如果一個語句更新N條記錄,這條語句視為在一個transaction中。但是命令數為N。
  • 如果命令在一個transaction中,不考慮CommitBatchSize ,只考慮CommitBatchThreshold。
  • 單個transaction不會被拆分成多個,就算單個transaction中的命令數超過CommitBatchThreshold。
  • 如果提交多個transaction,第一個transaction 的命令數沒有超出CommitBatchThreshold,則第二個transaction 會被合并如第一個。如果合并后的命令數超出CommitBatchThreshold,則不繼續合并,但是前兩個transactions照樣提交。
  • 如果命令不在一個transaction中,按照CommitBatchSize的設定將一定數量的命令合并成一個transaction。
  • 如果CommitBatchSize的值大于CommitBatchThreshold,一個CommitBatchSize的transaction會被進一步拆分成兩個,比如CommitBatchSize=5,CommitBatchThreshold=3,總命令數為10,會如下打包 4,1,4,1。為什么會出現4,請參見第5條,因為第一個包的命令數在向后合并中到第四個命令才超過CommitBatchThreshold。于是一個CommitBatchSize的transaction 被分成兩個 4,1。
  • 轉載于:https://www.cnblogs.com/coldwine/archive/2009/08/11/1543635.html

    總結

    以上是生活随笔為你收集整理的SQL Server Transactional Replication 中的 CommitBatchSize 和 CommitBatchThreshold 属性的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。