On 10 Oct 2009, at 9:27pm, Jay A. Kreibich wrote:

> On Sat, Oct 10, 2009 at 07:38:08PM +0100, Simon Slavin scratched on  
> the wall:
>>
>
>> Don't forget to use transactions, even for when you are just doing
>> SELECTs without changing any data.
>
>  Using transactions speeds up a long series of SELECTs because it
>  eliminates the need to re-acquire a read-only file-lock for each
>  individual SELECT.
>
>  Since in-memory databases have no file locks, I'm not sure that is
>  relevant to this specific case.

I wasn't sure about that.  It could still be slower, even if the  
individual transactions don't eventually result in any calls to file- 
handling routines.  At what point does the code decide whether a lock  
is needed ?  Does it get dropped almost immediately, or does it go  
through multiple levels of calls before some low-level code says "iff  
disk-database then lock" ?  Sorry, I've never looked at the source.

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

Reply via email to