On Monday, 7 October, 2019 03:16, Simon Slavin <slav...@bigfraud.org> wrote:
>> Given that we disable ceckpointing, can we assume that the main >> database-file will never be modified, and therefor could potentially be >> mounted read-only? No, and No. >You are correct that the WAL file contains database pages, rather than >SQL statements. A recent change to the way WAL files work means that if >an already-modified page is modified again, the page appears in the WAL >file only once. So the size of the WAL file depends more on how much new >data gets written to the database than the total number of changes. You are misstating the change. The correct statement is: "A recent change to the way WAL files work means that if a page ALREADY MODIFIED IN A TRANSACTION IS MODIFIED AGAIN IN THE SAME TRANSACTION, then that page appears in the WAL file only once FOR THAT TRANSACTION." That is to say that for each transaction appearing in the WAL file, each page modified by that transaction appears only once. If a given page is modified by multiple transactions then that page appears in the WAL file once for each transaction. It must be so or you could not have a "snapshot" position between transactions. However, if you are coalescing (checkpointing) three transactions from the WAL file to the main database, then indeed only the latest change to a page made by any of those transactions needs to be copied to the main file, even though each of the three transactions may have modified the same page. >Presumably you mean you disable /automatic/ checkpointing. If you >disable all checkpointing your writes never get completed. Sooner or >later you are going to have to let SQLite modify your database file, so >no, you can't mount it read-only if you want to make changes. -- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users