On Thu, Feb 10, 2011 at 6:45 PM, Michael Barton <[email protected]>wrote:
> Is there something I need to do to keep my sqlite WAL files from
> getting huge with 3.7.5?
>
> -rw------- 1 swift swift 152M 2011-02-10 23:43
> b7fa56688b61c70ef29ed2ad94b7beeb.db
> -rw------- 1 swift swift 19M 2011-02-10 23:43
> b7fa56688b61c70ef29ed2ad94b7beeb.db-shm
> -rw------- 1 swift swift 2.4G 2011-02-10 23:43
> b7fa56688b61c70ef29ed2ad94b7beeb.db-wal
>
> There the database is 152MB and the wal file is 2.4GB. This happens
> when we're benchmarking, so we have like 8 processes trying to write
> concurrently or whatever. Write transactions also slow down as the
> wal file gets bigger. I've read through the couple of threads on
> this, but never saw if there was a solution.
>
There needs to be a time when there are no read or write transactions using
the WAL so that it can reset, and you need to run PRAGMA wal_checkpoint
during that time. Otherwise the WAL will grow without bound.
See also the RESET option on PRAGMA wal_checkpoint that will appear in
version 3.7.6:
http://www.sqlite.org/draft/pragma.html#pragma_wal_checkpoint
http://www.sqlite.org/draft/c3ref/wal_checkpoint_v2.html
>
> -- Mike
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
--
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users