单大交易与多个小型交易
我正在设计一个系统,用户可以多次选择/插入/ update/ delete/删除多个表的多行行(基于某些逻辑的循环中的n次,n范围为1000至50,00,00,000)。在我的设计中,只有10个线程可以同时进行这项工作。假设单个迭代本身至少需要几秒钟,那么在交易中进行每次交易中每次迭代的优点是什么?
I am designing a system where users can select/ insert/update/ delete multiple rows of multiple tables multiple times (n times in a loop based on some logic, the value of n ranges from 1000 to 50,00,00,000). In my design, only 10 threads will be active simultaneously doing this job. Assuming a single iteration itself takes a few seconds at least, what are the advantages of doing each iteration in a single transaction vs some m iterations (value of m ranges from 100 to 1000) in a transaction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了理解我,一次交易中的每次交互都很容易控制,锁中的争论风险较低。相关的交易日志将很小。缺陷是其效率不是很好。
与某些M相互作用(M范围为100到1000的值)相比,它通常具有更好的性能。事务日志将更大。如果您可以确保没有锁的争论,那应该是一个更好的选择。
可以调整相互作用值。
For my understanding, each interaction in a single transaction is easy to control and low risk of contention in the lock. And the related transaction log will be small. The defect is its efficiency is not very good.
compared with some m interactions (value of m ranges from 100 to 1000) in a transaction, it has better performance normally. Transaction log will be larger. If you can ensure there is no lock contention, it should be a better choice.
The interactions value can be tuned.