All these UDF's are registered like this:

      RegisterUDF = sqlite3_create_function_v2(ByVal lDBHdl, _
                                               ByVal
cConn.UTF8BytesPointerFromUTF16String(strFunctionName), _
                                               ByVal lArgCount, _
                                               ByVal SQLITE_UTF8 Or
SQLITE_DETERMINISTIC, _
                                               ByVal lIndex, _
                                               ByVal lAddress, _
                                               ByVal 0, _
                                               ByVal 0, _
                                               ByVal 0)

RBS

On Wed, Jan 4, 2017 at 12:58 AM, Keith Medcalf <kmedc...@dessus.com> wrote:

>
> 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
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to