On 05/19/2014 02:26 PM, Simon Slavin wrote:
Are there any advantages to this other than increased speed ?

Nope. However I've yet to see anyone complaining that SQLite is too fast and shouldn't be faster :-)

I believe that on average an app using SQLite will have a distribution where a few queries are used repeatedly and others are used rarely. A statement cache helps the former and has no real effect on the latter.

To me it is telling that all these SQLite wrappers added statement caches. There must have been a performance incentive for so many to do the extra work, including DRH himself for his TCL wrapper.

It is very difficult to get statement caches right. They have to be thread safe, and they have to handle multiple statements correctly (eg "select 1; select 2"). They need to have bounded size. They interact with authorizers. They also have to have a copy of the SQL statement. SQLite already has to deal with all these issues, including keeping a copy of the statement so SQLite implementing the cache would save memory.

Roger

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

Reply via email to