On 13 Sep 2019, at 5:38pm, Jens Alfke <j...@mooseyard.com> wrote: > Does anyone have intuition or actual knowledge about which approach is > better? Or know of a 3rd better approach?
My guess is (b), but it will depend on your particular setup. Depends on cache size, storage speed, whether your OS is real or virtualized, etc.. I don't think the overhead of preparation will cause much of a delay. Solution (b) will require more memory than (a) since it has to keep the array of all keys in memory until the command is finished. There is, of course, solution (c): read every row and check in your software whether it has one of the keys you want. This requires preparing and executing one statement. If your list of keys covers most of the rows this may be fastest. And it uses the least memory. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users