Hi,
> Following worked fine in 20040723-snapshot:
>
> let $results :=
> util:eval("//codeSet[@name='profession']/codeSetElement[@valid='true'
> and string-length(@id) < 4]")
> And it was fast enough. But in beta-2-1107 the same query takes about 30
> times longer. Any hope for a fix for this?
Yes, I already fixed this. Earlier snapshots used to pre-load all the
@id nodes, so string-length(@id) was faster in general: the @id
attributes were already cached after the first call to the function. I
changed this in beta2 as it did not work well in all cases.
This points to a general problem, which I tried to address over the
weekend: the current CVS version adds new methods to the basic
Expression interface, which is the base interface for all XQuery
expression objects. In particular, all static checks and optimizations
will be moved to Expression.analyze(Expression parent, int flags), which
is called before the expression is evaluated. This makes it easier to
determine if an optimization like the one above is required or not.
I will upload a new snapshot once the CVS version is running stable again.
Wolfgang
|