> On Sep 12, 2017, at 11:09 AM, Warren Young <war...@etr-usa.com> wrote: > > From my reading of the docs, I don’t see that that is the purpose of > SQLITE_DETERMINISTIC: > > https://www.sqlite.org/deterministic.html > <https://www.sqlite.org/deterministic.html>
Actually it is. "A deterministic function always gives the same answer when it has the same inputs." That is the definition of a mathematical (also called "pure") function. Such a function call can of course be factored out as a common subexpression. > The purpose is simply so that the SQLite internals know whether it is safe to > use the user-defined function in certain query types. The reason SQLITE_DETERMINISTIC was added is to allow such functions to be used in indexes and then matched with the same function in a query. That allows indexing things like JSON properties (via the deterministic json_value function.) —Jens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users