开发者

Why do updates inside of a SQL transaction still need disk IO?

I开发者_JAVA技巧n SQL Profiler you can see that very simple updates to a table by primary key take about 10-30ms each. On about every 10th update the write column shows 1, on all other updates it shows 0. This must mean that about every 10th update statement still requires disk IO. I wonder why that is. Would it not be more efficient queue up all IO until the transaction commits?


And where would you wish to store these kind of memory updates once you update a table of size, lets say 10 000 000 records?

Where would you wish to store the transaction log.

AS plentifull as RAM seems, we cannot assume it is endless...


Also, waiting with I/Os until the end of transaction might not be the optimal plan even with endless RAM, because then the transaction would need to wait until all the I/O operations are finished.

Otherwise it is actually desirable to write to disk for long running transactions (but in such a way that atomicity is not broken).


That's the Transaction Log

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜