Re: [Modeling-users] SQLite inserts slow
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-06-29 18:39:35
|
Ok fine, and indeed, I've just read the documentation http://www.hwaci.com/sw/sqlite/lang.html#pragma and this definitely seems to be far less dangerous than what I thought it could be. Do you think this could be useful enough to have a setting to control that within the framework? For example we could have a env.variable 'SQLITE_SYNCHRONOUS_MODE' set to either 'NORMAL' (default), 'FULL' or 'OFF', an env.var. that the framework could use to set the synchr.mode when openin= g a connection. While we're at it, are there other PRAGMAs that you all using sqlite think they should be controlled in the same way? -- S=E9bastien. Ernesto Revilla <er...@si...> wrote: > Hi again, >=20 > Sebastien Bigaret escribi=F3: >=20 > >>Interesting enough that the following instruction makes it much faster > >>causing SQLite to turn off disk sync: > >>*PRAGMA default_synchronous =3D OFF; > >> > > > >Yes, but this makes the sqlite-db file very fragile, I believe this can > >completely waste your data when some errors happen, or am I wrong? (no > >time to check that in details right now) > > > > > It depends. sqlite writes all changes to a journal file, and when commiti= ng > processes the journal file and appends the results to the end of the > file. The fragile point is after the journal file has been processed, bu > before the data has been written to disk. Of course, this makes it more > fragile, but the probability of a system crash is not very high, provided= we > are using powersupplies and stable OS. If we have a patch for this issue, > I'll turn on syncing again. >=20 > With best regards, > Erny |