On 20 Sep 2016, at 8:59am, Jose Arroyo <jose.m.arroyo...@gmail.com> wrote:

> My current issue is that I'm encountering WAL checkpoint starvation and I'm
> trying to figure out a way to create checkpoint gaps only when needed.

Can I ask why you're trying to have as few checkpoints as possible ?  The fewer 
you have, the more time they take, the more annoying it is to your users, the 
more processes reach their timeout times.

I can understand that there are times when you want as few checkpoints as 
possible, but if you explain why then we may be able to suggest a strategy 
which doesn't involve hacking SQLite and becoming dependent on a particular 
version behaving a specific way.

For instance, you could use "PRAGMA wal_autocheckpoint=N" and use a smaller 
value for N than 1000.  That sort-of does what you asked since it will 
automatically fire when the WAL journal reaches a certain size (of unwritten 
data).

Another common strategy is that every process which does writing has a 
checkpoint every 1000 transactions.  Or 100.  or 10.  Whatever suits.  Again, 
it is a system which takes care of itself and will not stop working if a new 
version of SQLite handles WAL files differently.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to