SQL Server Transactional Replication 中的 CommitBatchSize 和 CommitBatchThreshold 属性
生活随笔
收集整理的這篇文章主要介紹了
SQL Server Transactional Replication 中的 CommitBatchSize 和 CommitBatchThreshold 属性
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
最近遇到一個在SQL Server transactional replication 里關(guān)于CommitBatchSize 和CommitBatchThreshold設(shè)置的問題,BOL里面的解釋很含糊:
http://kendalvandyke.blogspot.com/2008/11/how-commitbatchsize-and.html
根據(jù)我自己的分析,這兩個屬性的作用如下:
Distrabution Agent 將所有單條命令作為一個單位,CommitBatchThreshold和CommitBatchSize 是以單條命令數(shù)為標(biāo)準(zhǔn) 如果一個語句更新N條記錄,這條語句視為在一個transaction中。但是命令數(shù)為N。 如果命令在一個transaction中,不考慮CommitBatchSize ,只考慮CommitBatchThreshold。 單個transaction不會被拆分成多個,就算單個transaction中的命令數(shù)超過CommitBatchThreshold。 如果提交多個transaction,第一個transaction 的命令數(shù)沒有超出CommitBatchThreshold,則第二個transaction 會被合并如第一個。如果合并后的命令數(shù)超出CommitBatchThreshold,則不繼續(xù)合并,但是前兩個transactions照樣提交。 如果命令不在一個transaction中,按照CommitBatchSize的設(shè)定將一定數(shù)量的命令合并成一個transaction。 如果CommitBatchSize的值大于CommitBatchThreshold,一個CommitBatchSize的transaction會被進(jìn)一步拆分成兩個,比如CommitBatchSize=5,CommitBatchThreshold=3,總命令數(shù)為10,會如下打包 4,1,4,1。為什么會出現(xiàn)4,請參見第5條,因為第一個包的命令數(shù)在向后合并中到第四個命令才超過CommitBatchThreshold。于是一個CommitBatchSize的transaction 被分成兩個 4,1。
- 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
根據(jù)我自己的分析,這兩個屬性的作用如下:
轉(zhuǎn)載于:https://www.cnblogs.com/coldwine/archive/2009/08/11/1543635.html
總結(jié)
以上是生活随笔為你收集整理的SQL Server Transactional Replication 中的 CommitBatchSize 和 CommitBatchThreshold 属性的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 常用的图像数据集
- 下一篇: Win7+OpenCV2.4.10+VS