From looking at the source code, it seems to me that the values returned
on wal_hooks come from some sqlite's internal variables so it doesn't seem
to be possible to query the DB for it. I suspect that the WAL size can be
calculated from the WAL index file somehow, but I don't really grok how it
is actually used from the docs online (

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. The
scenario is pretty standard, one writer process and several readers
processes. The writer notifies the readers in some specific DB updates
scenarios, the readers query, do some stuff, update some fields by
messaging the writer process who will queue up those updates. After a
certain DB size, checkpoints start failing more and more often to the point
that the WAL size starts growing unbounded.

The caveat is that all this happens under a SPARQL layer and that I don't
have much room to modify how the writer process works. So I was wondering
if I could access the current number of pages in the WAL from outside the
writer process in a cheap way.

Any advice or guidance is greatly appreciated

José M. Arroyo
sqlite-users mailing list

Reply via email to