Re: [sqlite] [WAL] Querying/Finding out the WAL size (in pages) without trying to checkpoint

2016-09-20 Thread Simon Slavin
On 20 Sep 2016, at 2:39pm, Jose Arroyo wrote: > However, this writer process has no control over the reader processes, so > checkpoints may not necessary complete successfully ("If another connection > has a read transaction open, then the checkpoint cannot reset the

Re: [sqlite] [WAL] Querying/Finding out the WAL size (in pages) without trying to checkpoint

2016-09-20 Thread Jose Arroyo
On 20 September 2016 at 14:29, Simon Slavin wrote: > > On 20 Sep 2016, at 8:59am, Jose Arroyo 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

Re: [sqlite] [WAL] Querying/Finding out the WAL size (in pages) without trying to checkpoint

2016-09-20 Thread Simon Slavin
On 20 Sep 2016, at 8:59am, Jose Arroyo 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 ?

Re: [sqlite] [WAL] Querying/Finding out the WAL size (in pages) without trying to checkpoint

2016-09-20 Thread Paul Sanderson
Please let me know if this works for you - I've never tried it so at the moment it's just an idea :) Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit -Forensic Toolkit for

Re: [sqlite] [WAL] Querying/Finding out the WAL size (in pages) without trying to checkpoint

2016-09-20 Thread Jose Arroyo
The writer process doesn't ever do "truncating" checkpoints, even if it does handle checkpoints manually. I'm starting to realize that truncating checkpoints are a good idea, especially after going through "checkpoint starvation" moments... In that case, I think I could make your suggestion work.

Re: [sqlite] [WAL] Querying/Finding out the WAL size (in pages) without trying to checkpoint

2016-09-20 Thread Paul Sanderson
From within SQLite - I don't know if its possible. But if you can query the WAL file size you should be able to determine the number of pages easily enough. pages = (walfilesize-32)/(DBpagesize+24) the only caveats I can think of are: The WAL file is not truncated after a checkpoint so you