On 24 Nov 2009, at 9:17pm, Pavel Ivanov wrote:

> Indeed, it's weird. And I've just realized that if we have two
> simultaneous write transactions they both have to write their own
> journal whenever they wish to write something to disk. SQLite database
> cannot have two different journal files, so it should serialize
> transactions whenever they want to actually write something to the
> file.

Naturally.  We all know that you have only one data structure here.  You cannot 
have two threads/processes/applications actually change the database file at 
once: they'd find inconsistencies where TABLE data had already been changed but 
INDEXes had not been updated.  You can't have them both looking for a new blank 
page to write in and accidentally choosing the same page.  You need to have one 
do its work and then the other.

This is why a lot of the questions here about attempts to speed things up by 
using multiple threads/processes/databases are pointless.  When it comes down 
to it you do still have just one computer updating one hard disk.  Whatever 
work has to be done does have to be done in the end.  All you're doing is 
changing the order things are done in.

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

Reply via email to