I'm playing around with WAL mode here for the first time, along with some of 
the pragmas, and I'm getting some weird results. I was hoping someone could let 
me know if I'm missing something, or if yes, it is indeed weird.

For starters, I'm looking at the journal_size_limit pragma.
http://www.sqlite.org/pragma.html#pragma_journal_size_limit
In its description it does say that it works for WAL mode. "To always truncate 
rollback journals and WAL files to their minimum size, set the 
journal_size_limit to zero." So I create a new database, turn on WAL mode, set 
that pragma, create a table, and insert some stuff into it. Then I check the 
file sizes, and the -wal file hasn't shrunk at all. I made sure it was large 
enough to go over the wal_autocheckpoint threshold and it didn't shrink. I ran 
a manual "pragma wal_checkpoint;" and it didn't shrink. I tried with specifying 
passive, full, and restart and it didn't shrink. It seems that I can only get 
it to shrink by doing an explicit "pragma wal_checkpoint(truncate);" But if 
that's the only way to shrink the file down, then what's the point of the 
pragma here?

Or, as is more likely, what obvious thing is my brain missing at the end of the 
day?

(Tested with pre-compiled Windows CLI 3.15.0 in Windows 7. I did refresh the 
folder in a Windows Explorer window to make sure it wasn't just stale directory 
info for the file sizes)

Thanks for any help,
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to