Hi all, I read the documentation about the synchronization pragma.
It got to do with how often xSync method is called.
With synchronization = FULL xSync is called after each and every change to
the DataBase file as far as I understand...

Observing the VFS interface used by the SQLITE:

typedef struct sqlite3_io_methods sqlite3_io_methods;
struct sqlite3_io_methods {
  int iVersion;
  int (*xClose)(sqlite3_file*);
  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
  *int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);*
  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
 * int (*xSync)(sqlite3_file*, int flags);*

*
*

I see both xWrite and xSync...

Is this means that xWrite initiate  a FS write to the file?

Is that means that xSync makes sure that the FS buffered changes are
synced to disk?

I guess it is calling fsync in case of LINUX /FreeBSD am I right?


If the above is correct and SQLITE operates over modern reliable FS
that has journaling with each write, than despite the fact that the
write buffer cache are not fully synced they are protected by the FS
journal that fully records all the changes to the file and that is
going to be replayed in case of a FS mount after a system crash.

If  my understanding is correct than assuming the FS journaling  is
bullet proof than I can safely operate with synchronization = OFF with
SQLITE and still be fully protected by the FS journal in case system
crash, right?

Meaning synchronization = NORMAL doesn't buy me anything in fact it
severely slows the Data Base operations.

Am I missing something here?


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

Reply via email to