On 9/12/17, Jens Alfke <j...@mooseyard.com> wrote: > SQLite 3.19 doesn’t seem to coalesce identical calls to a deterministic > function. For example, in this query, where `fl_value` is a function I’ve > registered as SQLITE_DETERMINISTIC: > > SELECT key FROM kv_default > WHERE fl_value(body, 'contact.address.state') = 'CA' > OR fl_value(body, 'contact.address.state') = 'WA' > > fl_value gets called twice per row in the table, with the same inputs both > times of course. As fl_value is not a cheap function — it’s similar to > json_value — it would be a noticeable speedup if it were evaluated only once > per row.
... WHERE fl_value(body,'contact.address.state') IN ('CA','WA'); -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users