On 12 Jan 2013, at 5:38pm, Wayne Bradney <wayne_brad...@yahoo.com> wrote:

> "mode=memory&cache=shared"


> 1. when shared cache is enabled, all reads are serialized, and

All access in SQLite is serialised.  All transactions require locking the 
entire database.  SQLite is very simple -- 'lite' -- so queries run extremely 
quickly, so you don't normally realise that any locking has taken place.

> 2. there doesn't seem to be any way to have a memory-backed database that can 
> be accessed by multiple connections without using a shared cache,  then I 
> guess I MUST use a file-backed database to get concurrent reads, even though 
> I don't need the persistence and don't want to take the I/O hit. Am I making 
> any sense? Anything I'm missing? 

You are putting programming effort into making your code fast, and this is 
costing you (or your employer) programmer time.  Have you tried doing this 
using an SSD instead of a spinning disk ?  A great deal of the time taken for 
on-disk SQLite is waiting for the disk to spin to the right place.  With an SSD 
all this time vanishes and access is nearly as fast as for in-memory databases. 
 The advantage is that you don't spend your time on clever optimal programming 
or have to do any of the things required for 'mode=memory'.  In fact it works 
very quickly without any special modes or PRAGMAs at all.  Though I don't know 
your setup in detail and it may not be of such a great advantage to you.

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

Reply via email to