Hello,
thanks to the all the answers I received in the thread "Optimization of
a slow query with `//`" I can now make most of my queries much faster.
However, while rewriting these queries I noticed that almost all the
queries in my application could be rewritten in the form
/tei:TEI/tei:text/tei:body//tei:ELEM[PREDICATE]
and I wondered if it was possible to tell BaseX (or to have it
understand by itself) that it can cache and reuse the results of
/tei:TEI/tei:text/tei:body//tei:ELEM
and only apply PREDICATE on the saved set of results.
Is something like this available in BaseX?
I suppose this could have a big impact on my queries, because the base
query executes in about 250 ms and most of the other unoptimized queries
in about 280 ms. This means that with the case in place they should
complete in 30 ms (or 50 ms in more realistic terms).
I tried sending via HTTP a dummy request for
`/tei:TEI/tei:text/tei:body//tei:ELEM` together with a `<option
name='cachequery' value='true'/>` to warm up the cache. Unfortunately
all I got back was a "Unknown option 'CACHEQUERY'" error (with BaseX
8.2.1). Any idea why?
Regards,
--
Gioele Barabucci <[email protected]>