On 17 May 2014, at 9:55pm, Baruch Burstein <bmburst...@gmail.com> wrote:
> What is the overhead of holding open a prepared statement? If my program is > not time critical at all (it is mostly UI bound), but every once in a while > (anywhere from 10 times a second to once every 10 minutes) it needs to run > a few querys, would it make more sense to prepare all of the querys once at > the start of the program (40-50 different querys for the whole program, but > only 2-3 are run at a time), prepare-step-finalize each time as needed, or > (most likely) it doesn't really make a difference in this situation? No big memory overhead though there is some memory overhead for a prepared query and much more for a query you've executed the first _step() on. No slow-down in any API call just because you have lots of statements prepared. No other reason why you shouldn't do it. If you need to execute the same queries repeatedly it's a reasonable thing to do. You will need to finalize or reset all prepared statements before closing the database. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users