by zackees · 3y ago · 0 comments
WAL mode has some issues where depending on the write pattern, the WAL size can grow to infinity, slowing down performance a lot. I think this usually happens when you have lots of writes that lock the table so sqlite never gets to doing wal_autocheckpoint.
I believe that WAL2 fixes this: Wal2 mode does not have this problem. In wal2 mode, wal files do not grow indefinitely even if the checkpointer never has a chance to finish uninterrupted
https://sqlite.org/cgi/src/doc/wal2/doc/wal2.mdI wonder if this could be further extended to better support concurrent writes. Depending on the implementation, with wal2 readers may be reading from both hot and cold files without blocking. So this may potentially be extendable to read from two hot files, or two hot files and two cold files.
sqlite> PRAGMA journal_mode = delete;
delete
sqlite> PRAGMA journal_mode = wal2;
delete
Does this mean wal2 is not available?[0]: https://www.sqlite.org/src/doc/begin-concurrent/doc/begin_co...