On 11 Mar 2014, at 12:20pm, Dan Kennedy <danielk1...@gmail.com> wrote:

> Or "PRAGMA locking_mode=EXCLUSIVE; PRAGMA journal_mode=PERSIST;",
> if there will only ever be a single connection to the database.
> 
> Or you could build with SQLITE_DISABLE_DIRSYNC, which omits all
> syncs on directories. Of course, that will slightly increase the
> chances of a power failure causing database corruption.

'slightly' is more like 'greatly'.  At least, that's my understanding of the 
characteristics of the most common file systems these days.

Also watch for file systems which store the length of the file as a file 
attribute you can read without opening the file.  This means that every time 
the file changes length, you /do/ have to rewrite the metadata.  One of the 
nice things about some SQLite modes is that the number of pages changes rarely 
(pages are marked as unused rather than the file shortened).  This means that 
it's not necessary to change metadata very often.

The "PRAGMA journal_mode=PERSIST" thing is a great tip and should make a of 
difference for some operations.  I'll add to that my advice to leave 
auto_vacuum off.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to