Christian,
Thanks for your prompt reply.
I had tried db:attribute for quicker look-up but the bottle-neck for me is the usage part and not the retrieval part. Retrieval is quick but good to know that it has been taken care of in latest stable version of BaseX.
There are several joins due to complexity of data happening in the query that use this data coming from foo:get-node-v1(all the three parameters that are passed to this function are small objects.) To give you a quick overview of the query I have:
:
:
let $aNodes := foo:get-a($context)
let $bNodes := foo:get-b($context)
let $scopeValues := foo:get-node-v1($context, $project, $scopeName)
for $aNode in $aNodes
for $bNode in $bNodes[<predicate>]
:
:
let $val := $foo:another-function($scopeValues, $bNode)
foo:another-function is basically filtering $scopeValues relevant to $bNode. We have a high number of $aNodes and $bNodes.
If I use the second variation wherein the data content is exactly same (only difference is that is local copy now) then my xquery performs way better.
Is there a way to get a local copy of the database node so that we do not reference the node in the database for further usage in the xquery (any other cleaner way instead of iterating over the data and creating a local copy that foo:get-node-v2 is doing)?
Thanks,
Teena