On 24 Jul 2014, at 3:21pm, Tom <t...@meanfox.com> wrote:

> My application presently does all the DB operations on the main thread. But
> once a day I need it do the player leaderboards, which could be 500K players
> or so, hence several minutes. I can't have the main thread blocking for any
> significant length of time - a second or so at most. Hence my desire to do
> that one long operation in a separate thread and not have other DB writes
> block.

Even 500K players shouldn't be taking SQLite "a few minutes" unless there are 
no good indexes to use.  Are the scores saved in your player table ?  Do you 
have indexes suitable for the commands you are executing ?

> I don't suppose temporary tables would make any difference? I.e. use a
> temporary table for the LB results. Would that allow concurrent writes? (to
> temporary table, and to normal table, from different threads).

It still won't do what you want.  Dr Hipp's suggestion of WAL mode is probably 
your best bed.  With this you can have many readers and one writer all working 
at the same time.

> What about using 2 databases?

It would probably be better to try figuring out good SELECTs and indexes first.

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

Reply via email to