Re: SQLite inserts slow

Ernesto Revilla <[email protected]> Thu, 24 Jun 2004 11:21:05 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
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


>-- Sébastien.
>
>
>  
>