I generate a “where used” index as an XML doc in a separate database.
I’m then doing lookups against this index like this where $node is the element I want to find the index entry for:
collection($rkDatabase)/doc-where-used-index/where-used-entry[string(@key) eq string(db:node-id($node))]
Where the markup is shown in [1] below.
Using prof:track() I’m measuring a consistent 0.036 seconds per lookup, which seems very slow. Db:node-id() is instantaneous so the cost must be in the XPath itself. I’ve tried different variations on the predicate but nothing makes a measurable
difference.
There must be a more efficient way to do this kind of lookup or a better way to structure my index XML so that the lookup is optimized.
Or is this something that could be affected by my index settings at the database level?
Thanks,
Eliot
[1] Where-used index markup:
<doc-where-used-index>
<where-used-entry key="9151416" tagname="map" class="map/map" id="">
<title>
<ph keyref="workplace-safety-management"/>
</title>
<conrefs/>
<topicrefs>
<noderef node-id="672471" database="tokyo" tagname="mapref" baseuri="/tokyo/qa-sushma-sundareswaran.ditamap" href="workplace-service-delivery-core.ditamap"/>
<noderef node-id="898684" database="tokyo" tagname="mapref" baseuri="/tokyo/qa-ankit-jaiswal.ditamap" href="workplace-service-delivery-core.ditamap"/>
<noderef node-id="9524996" database="tokyo" tagname="mapref" baseuri="/tokyo/workplace-service-delivery-suite.ditamap" href="workplace-service-delivery-core.ditamap"/>
</topicrefs>
<doc>
<noderef node-id="9151416" database="tokyo" tagname="map" baseuri="/tokyo/workplace-service-delivery-core.ditamap"/>
</doc>
<xrefs/>
<referencing-maps>
<noderef node-id="672452" database="tokyo" tagname="map" baseuri="/tokyo/qa-sushma-sundareswaran.ditamap"/>
<noderef node-id="898667" database="tokyo" tagname="map" baseuri="/tokyo/qa-ankit-jaiswal.ditamap"/>
<noderef node-id="9524980" database="tokyo" tagname="map" baseuri="/tokyo/workplace-service-delivery-suite.ditamap"/>
</referencing-maps>
</where-used-entry>
…
</doc-where-used-index>
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368