On Fri, 2017-12-29 at 22:18 +0000, Simon Slavin wrote: > > On 29 Dec 2017, at 7:07pm, Ian Freeman <i...@ifreeman.net> wrote: > > > Thanks, Simon. Indeed I did see that option. But I'm concerned > > about > > maintaining integrity in the middle of an power-interrupted commit, > > This is not a problem for either WAL mode or the older journal > modes. If you avoid these commands > > PRAGMA journal_mode = OFF > PRAGMA journal_mode = MEMORY > PRAGMA synchronous = OFF > PRAGMA synchronous = NORMAL > > then SQLite will ensure that the database file always reflects your > data as it was before the more recent COMMIT or after the most recent > COMMIT. >
Agreed, the defaults would be very safe. But I realize I never mentioned what my actual goal was: minimizing disk writes for a write- heavy application. That's why I want to run -wal out of memory, or set synchronous=NORMAL. Of course, I cannot do this at the expense of integrity. There are other ways to solve my problem, for example I could operate solely in memory and perform periodic online backups. But then I'm dumping entire databases to disk when I really only need to capture a single row's update, etc. Those could be minimized with breaking up the database into sub-sections, etc. But if I can just keep the -wal updates off of the disk until checkpoint, it would be the best solution. Thanks, all. I'm still open to your appreciated input as I mull this over. On Fri, 2017-12-29 at 15:09 -0700, Barry Smith wrote: > I believe the inotifywait does not actually wait for the fsync > operation before notifying. Barry Smith is making me question my inotifywait results. I need to look into that further. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users