Thanks Nico, and everyone else.

A 3x speed bump is still good, so I've set journal_mode to WAL.  The 
docs seem to suggest I only need to do this once, but I presume that 
doing it once every time I open the database is acceptable?

Thanks,
Ian

On 03/06/2011 15:42, Nico Williams wrote:
>
> On Jun 3, 2011 10:04 AM, "Ian Hardingham" <i...@omroth.com 
> <mailto:i...@omroth.com>> wrote:
> >
> > Thank you Igor, I'll do some more thorough profiling.
> >
> > When I run the query:
> >
> > UPDATE multiturnTable SET complete=1 WHERE id=-50000
> >
> > This takes ~45ms (as reported by SQLite's profile) - is this in the
> > right ballpark?  I'm running a fairly fast modern intel chip here.
>
> In journal mode, yes: that's in the ballpark of what three fsync() 
> calls should take, and that's how many fsync calls SQLite makes at 
> commit time in journal mode.  WAL mode should go faster because most 
> often it does a single fsync().  But even three times faster will seem 
> too slow to you, no doubt.  To go faster consider batching updates 
> into larger transactions (so as to amortize the synchronous I/O cost) 
> or using fast flash devices to hold your DB.  Also, serialize your 
> writing if you can.  Finally, consider some other method of obtaining 
> durability, such as logging updates to a large, widely distributed 
> memcache farm, then disable fsync for most transactions.
>
> Nico
> -- 
>

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

Reply via email to