On 4/26/17, Kim Gräsman <[email protected]> wrote: > > But for some reason, the WAL-index (-shm) file also grows to about > 40MiB in size. From the docs, I've got the impression that it would > typically stay at around 32KiB. Does this seem normal?
The -shm file is an in-memory hash table, shared by all processes accessing the database, used to quickly locate pages that have previously been written into the WAL file. The size of the -shm depends on the number of pages in the -wal file. Each entry requires 8 bytes. So if you take the total number of pages in the database that are being modified, multiply by 8 and round up to the next multiple of 32K, that will be the -shm file (approximately - there is some small adjustment for a header on the first page o the -shm which we shall ignore here). 40MiB seems like a lot. That would imply you are changing about a half million pages of your database inside a single transaction. What is your page size, and how big does the -wal file get? -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

