Dan Kennedy <[EMAIL PROTECTED]> wrote: > For SQLite 3, the default value of the 'synchronous' pragma > changed from "NORMAL" to "FULL". IIRC this means the disk is > synced 3 times instead of 2 for a small transaction. So this > might be what you're seeing.
That is indeed the case. The sqlite FULL commit for the journal code works like this 1) Write all journal pages 2) Fsync 3) Update counter of journal pages in the journal header 4) Fsync Why not do it like this instead: 1) Check if counter in header matches the file size 2) Write all journal pages 3) Update counter of journal pages in the journal header 4) Fsync And whenever there's a rollback look at the counter in the header to see if it matches the file size, or alternatively compute the number of pages from the file size.