简体   繁体   English

谁能解释为什么预写日志使用NO-FORCE?

[英]Could anyone explain why is Write-Ahead Log the use NO-FORCE?

As I searched online, STEAL and FORCE is defined as follows 当我在线搜索时,STEAL和FORCE的定义如下

FORCE or NO-FORCE: Should all updates of a transaction be forced to disk before the transaction commits? FORCE或NO-FORCE:是否应在提交事务之前将所有事务更新强制插入磁盘?

Besides, I was told that 另外,我被告知

A transaction is not considered committed until all its log records have been written to stable storage 在事务的所有日志记录都已写入稳定存储之前,该事务才被视为已提交

Then how is WAL different from a FORCE approach? 那么,WAL与FORCE方法有何不同? I feel like in both cases, changes has to be flushed to disk as we commit the transaction.... 我觉得在两种情况下,提交事务时都必须将更改刷新到磁盘上。

With WAL you have a sequential writes to a log. 使用WAL,您可以连续写入日志。 The updates to pages throughout the database can be written asynchronously to the log entries. 整个数据库中页面的更新可以异步写入日志条目。

A force approach requires that all dirty pages in the buffer pool be flushed to disk synchronously with the commit operation. 强制方法要求与提交操作同步将缓冲池中的所有脏页刷新到磁盘。 This is a much more expensive operation and limits throughput. 这是昂贵得多的操作,并且限制了吞吐量。

Basic tradeoff: Longer recovery time after a crash with WAL vs. lower throughput with force. 基本的权衡:WAL崩溃后的恢复时间更长,而强制下的吞吐量更低。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么 SQL 数据库在命令日志上使用预写日志? - Why do SQL databases use a write-ahead log over a command log? 你会在预写日志中登录什么? - What would you log in a write-ahead log? 数据库事务,预写日志和索引 - Database transactions, write-ahead logs, and indexes Oracle是否使用偷窃/无力方法? - Does Oracle use steal/no-force approach? Android中的预写日志记录会产生影响吗? - Does write-ahead logging in Android have any impact? WAL(write ahead log)怎么能比直接写入磁盘有更好的性能呢? - How could WAL (write ahead log) have better performance than write directly to disk? 我可以总是刷新一个预写日志而不是实现一个两阶段提交协议吗? - Could I just always flush a write ahead log instead of implementing a Two-Phase Commit protocol? 如何在 C++ 程序中启用 WAL(预写日志)? - How to enable WAL (write ahead log) in a C++ program? 如何在FMDB iOS中启用预写日志记录? - How to enable write ahead logging in FMDB iOS? SELECT COUNT(*)…&SELECT table_name,table_rows…; 给出不同的结果(行数),谁能解释,为什么? - SELECT COUNT(*)… & SELECT table_name,table_rows …; Giving different results (row count), can anyone please explain, why?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM