I have C functions that are invoked during queries. Some of these functions take parameter strings that need parsing, sort of like JSONPaths. I use sqlite3_set_auxdata to memoize the parsed versions of these.
I just noticed that, when these functions are used in indexes — e.g. "CREATE INDEX foo ON table (foo(col, 'x.y.z'))" — then when the function 'foo' is invoked during a row insertion, the sqlite3_set_auxdata has no effect. Thus the function ends up parsing the 'x.y.z' string over and over, once per inserted row. This accounts for about 10% of the runtime of the function (it would be more if the path were more complex). I'm aware that sqlite3_set_auxdata isn't guaranteed to cache the value, in fact the docs only go so far as to say it "may be preserved". However, it would be good for performance if it could be cached in this situation. —Jens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users