Re: [sqlite] Best practices for huge batch inserts with WAL?

2017-04-24 Thread Clemens Ladisch
Scott Hess wrote: > WRT #3, you could also consider journal_mode off (or memory, if your code > requires transactions to work right). In that case, the database state is > indeterminate if you have an app-level crash, but you should be fine if you > make it to the end. It would be a better idea

Re: [sqlite] Best practices for huge batch inserts with WAL?

2017-04-24 Thread Scott Hess
What I'd do: 1) Look at the indices, and make sure the input is sorted to insert in index order. Also drop any unnecessary indices and add them back at the end. [Read the code for vacuum to see what kinds of things make sense to defer.] 2) Bump up the cache a lot. Inserting in sorted order

Re: [sqlite] Best practices for huge batch inserts with WAL?

2017-04-24 Thread John Found
Do you have some indices on the table? Drop them before the huge insert and then recreate again. It is faster. On Mon, 24 Apr 2017 11:00:00 -0700 Jens Alfke wrote: > I’m importing a large data set with a lot of rows — an entire Wikipedia dump, > about 60GB, one article per