On Tuesday, 3 January, 2017 17:18. Simon Slavin <slav...@bigfraud.org> wrote:
> On 4 Jan 2017, at 12:09am, Bart Smissaert <bart.smissa...@gmail.com> > wrote: > > > Secondly, can the Explain statement tell me that indeed the UDF runs > 100000 > > times in the first SQL and only once for the second SQL? > > What makes you think that this is the case ? Why would SQLite not be > running the UDF 100000 times in both cases ? > > Did you build any caching of results into your UDF ? If not, then SQLite > has no idea it can optimize it by checking to see if it’s using the same > parameters each time. You do not need caching in the UDF for that, you just need to set the SQLITE_DETERMINISTIC flag when defining the function. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users