On 3/2/15, Doug Nebeker <admin at poweradmin.com> wrote: > In the documents, using PRAGMA synchronous 1 (NORMAL) is supposed to be safe > unless there is an OS crash or power failure. > > I've had a few customers (about one a month, out of thousands) that is > getting the "database disk image is malformed" ExtErr=11 error with the > NORMAL pragma, and they claim there was no crash, power failure or anything > else unusual. The database _does_ get hammered under normal operation. > > There are two separate sqlite3* handles to the database. Each one is > protected by a critical section, so there is never more than one thread > accessing a handle at a time. The database is on a local NTFS drive. > > Two questions: > > 1. Is setting synchronous to FULL necessary to prevent these corruption > problems?
Not that we are aware of. > > 2. NORMAL is much slower than NONE. Is FULL much slower than NORMAL? > Depends on whether you are using WAL mode or not. -- D. Richard Hipp drh at sqlite.org