I'm experimenting with SQLite and found there's a big difference in speed
depending on the setting of PRAGMA SYNCHRONOUS.
I understand that settings other than"2" for this parameter don't guarantee
that data is safely stored on disk when che COMMIT statement terminates.
I wonder if it is possible to mix various settings of PRAGMA SYNCHRONOUS in the
same program, i.e. issue a "PRAGMA SYNCHRONOUS 2" before performing very
important transactions and using a lower PRAGMA SYNCHRONOUS value before
performing less important transactions.
If this is not possible because PRAGMA SYNCHRONOUS can only be issued once when
attaching to the database, I'm considering dividing to workload between two
processes or threads that write on the same database. One thread woud use
"PRAGMA SYNCHRONOUS 2" and would be responsible for critical database updates
and the other thread would use "PRAGMA SYNCHRONOUS 0" and would be responsible
for less critical updates.
Anybody knows if either of this two solutions will work reliably ? Which one is
the best (in terms of data safety) ?
Thank you, bye
---------------------------------
Yahoo! Messenger: chiamate gratuite in tutto il mondo