gpt4 book ai didi

sqlite - WAL 同步正常与关闭

转载 作者:行者123 更新时间:2023-12-03 01:20:03 26 4
gpt4 key购买 nike

在 WAL 的原始文档中,清楚地说明了 FULLNORMAL 同步之间的区别 1 :

Write transactions are very fast since they only involve writing the content once (versus twice for rollback-journal transactions) and because the writes are all sequential. Further, syncing the content to the disk is not required, as long as the application is willing to sacrifice durability following a power loss or hard reboot. (Writers sync the WAL on every transaction commit if PRAGMA synchronous is set to FULL but omit this sync if PRAGMA synchronous is set to NORMAL.)

但是我在任何地方都找不到 WAL 模式下 PRAGMA synchronous = OFF 的效果。我怀疑它与NORMAL相同。有人有知情答案吗?

最佳答案

documentation还说:

In WAL mode when synchronous is NORMAL (1), the WAL file is synchronized before each checkpoint and the database file is synchronized after each completed checkpoint and the WAL file header is synchronized when a WAL file begins to be reused after a checkpoint.

所以使用OFF,对于正常交易没有区别,但是任何checkpoint会不安全。

关于sqlite - WAL 同步正常与关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44755268/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com