Hi all,
I am surprised that fn:id() does take quite a long time in contrast to (almost) equivalent XPaths.
An example:
XQUERY collection('zk/')//id('zkI_108-5_R')
<div xmlns="http://www.tei-c.org/ns/1.0" xml:id="zkI_108-5_R"> ... </div> Query executed in 5956.43 ms.
XQUERY collection('zk/')//*[@xml:id='zkI_108-5_R']
<div xmlns="http://www.tei-c.org/ns/1.0" xml:id="zkI_108-5_R"> ... </div> Query executed in 9.43 ms.
Couldn't the first XQuery be optimized into the second? If not, maybe an xml:id index would be a good feature. eXist-db does have one, particularly dedicated to speed up fn:id() [1].
Best regards, Sebastian Zimmer
[1] http://exist-db.org/exist/apps/doc/indexing.xml