On Fri, Aug 14, 2009 at 05:10:40PM +0800, Michael Han scratched on the wall:

> My question is can I safely turn off this flag if the underlying file
> system supports journaling?

  No.
  
  As the docs state, with synchronous=ON the system verifies the data
  actually hits disk before proceeding.  With =OFF, it lets the OS deal
  with it.  This means the data may be suck in system buffers, device
  caches or other places.  If the data never makes it to the physical
  disk, it doesn't matter what format your file-system is in.

  With a journaled file-system synchronous=ON could consider the data
  "physically written" when it is put into the journal.  While this
  might be slightly faster than a traditional filesystem, and the OS
  may be slightly more aggressive about flushing stuff to the journal,
  it is still going to be slow next to =OFF.

> Does this mean that whatever the underlying file system is, there
> is a chance that database gets corrupted?

  With synchronous=OFF, yes, that's my understanding.  I've never
  worked with fully transactional file-systems, but I believe the same
  still applies (just the number of writes is different).

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to