ldf文件与mdf文件放在不同磁盘可提高性能的原因


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

磁盘负责三方面,一个将数据写入到日志文件ldf中,然后在check point后写入到mdf, 接着就是大量的读操作。
先写入ldf,是因为sql server的预写日志机制引起的,此机制保证了数据在写入到mdf中前,一定会在ldf中保留一份,这样以后恢复等操作都可进行,故可以说,影响写性能的主要是写入到ldf中的操作。磁盘一边负责随机取数据,一边负责写入数据,磁头转来变去,性能低下,而将ldf文件放在不同的磁盘中,就独立了写操作。
注意:磁盘应是物理上的。

Other logical drive will not benefit because ultimately, it’s the same drive controller and the same physical disc. Hence, if the heads are busy doing random reads for a logical drive D, they won’t be able to perform serial writes on logical drive E on the same physical drive.

Hence, the log should be given the priviledge of it’s own separate physical drive.
引自:
Performance Best practice – Transaction log must on a different drive. But WHY?
Write-Ahead Transaction Log