I believe SQLite also has to write the data twice, using the WAL. Maybe there is an optimization to avoid that though.
I believe SQLite also has to write the data twice, using the WAL. Maybe there is an optimization to avoid that though.
If I understand correctly, it writes the data twice if you're not using WAL. With WAL, it only writes the data once [1].
[1]: The "Performance Considerations" section of https://www.sqlite.org/wal.html
> The original content is preserved in the database file and the changes are appended into a separate WAL file.
The difference is whether the journal keeps the new data (WAL) or the old data (not WAL). If you are writing big chunks of data, WAL will probably be more I/O intensive.
Taking a wild guess I'll say that if you are adding data to the database, and not using WAL, the data will only be written once since the journal won't keep a reference to old data if no pages is being overwritten.