Simon Slavin wrote: > On 28 Apr 2014, at 11:11pm, RSmith <rsm...@rsweb.co.za> wrote: > >> Second approach is better when you rarely access the database, also it will >> make sure releases happen (or at least provide immediate errors if not), but >> keeping a connection open is much better when hundreds of accesses happen in >> terms of speed - especially loads of small queries, large queries won't >> matter either way. > > I add two other reasons to Ryan's: if you are extremely short of memory (for > example in a tiny low-power device) or if your file system lacks proper > flushing because although flush() is documented in reality it does nothing.
s/flush/sync/. However, I don't see just how closing/opening db will make it any better. Database/journal is written and synced at transaction end, not at "connection" close. > But as others are saying, on a desktop/laptop computer your only result will > be to slow things down. Yep. Also, if you keep connection open, you can save some time on keeping/caching prepared statements (you must finalize all statements before you close "connection") _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users