gpt4 book ai didi

sqlite - 关于 SQLite 中的journal_size_limit 的澄清

转载 作者:行者123 更新时间:2023-12-01 18:28:31 28 4
gpt4 key购买 nike

如果我设置journal_size_limit = 67110000 (64 MiB) 我能够:

  1. 处理/提交超过该值的事务(不太可能)
  2. 能够成功执行VACUUM (即使数据库有 3 GiB 或更多)

The VACUUM command works by copying the contents of the database into a temporary database file and then overwriting the original with the contents of the temporary file. When overwriting the original, a rollback journal or write-ahead log WAL file is used just as it would be for any other database transaction. This means that when VACUUMing a database, as much as twice the size of the original database file is required in free disk space.

文档中并不完全清楚,如果有人能确切地告诉我,我将不胜感激。

最佳答案

journal_size_limit 不是交易日志的上限;这是非事件交易日志的上限。

事务完成后,不需要日志,但是删除日志可以使处理速度更快,因为文件系统不需要释放这些数据,然后为下一个事务重新分配它.

此设置的目的是限制未使用日志数据的大小。

关于sqlite - 关于 SQLite 中的journal_size_limit 的澄清,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16547263/

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