Re: [Modeling-users] SQLite inserts slow
Status: Abandoned
Brought to you by:
sbigaret
From: Ernesto R. <er...@si...> - 2004-06-29 19:01:02
|
Hi, I don't know, but I think this is not needed. Just a little comment in the documentation should be enough, because changing the * *default_synchronous * *setting with PRAGMA is permament setting. Of course, if you have to rebuild the database hundreds of times, this would be a nive feature. Anyway, perhaps it would be a nice thing to have the possibility to do initialization for each connection. For postgresql and others it can be used to set the isolation level, any encoding or language parameters, query modes, etc. Regards, Erny Sebastien Bigaret escribió: >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 opening 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ébastien. > > >Ernesto Revilla <er...@si...> wrote: > > >>Hi again, >> >>Sebastien Bigaret escribió: >> >> >> >>>>Interesting enough that the following instruction makes it much faster >>>>causing SQLite to turn off disk sync: >>>>*PRAGMA default_synchronous = 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 commiting >>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. >> >>With best regards, >>Erny >> >> > > > > |