caching - Need help rewriting XQuery to avoid expanded tree cache full error in MarkLogic -


i new xquery , marklogic. trying update documents in marklogic , extended tree cache full error. work done have increased expanded tree cache not recommended. tune query not need simultaneously cache xml.

here queryenter image description here

i have uploaded query image because not pretty when pasted on editor. if 1 knows better way please suggest.

thanks in advance.

i've solved scenario. there 2 things did

  • i put node-replace , node-insert type calls (that calls modify xml structure separate module , called module using xdmp:invoke, passing in parameters required, this

    let $update := xdmp:invoke("/app/lib/update-attribute-node.xqy", (xs:qname("newvalue"), $new), {xdmp:modules-database()})

the reason why works call xdmp:invoke happens in it's own transaction , once completes, memory cleared up. if don't then, each time call update or insert function, not write, until end in single transaction meaning memory fill pretty quickly.

  • any time needed loop on paths in marklogic (or documents or whatever called - i've been using marklogic few days) , there large number of them processed them few @ time below. came elaborate way of skipping , taking batch of documents @ time, can in number of ways.

    let $whatever:= xdmp:directory("/whatever/")[$start $end]

i put separate module processed , not in single transaction.

putting expensive calls separate modules , taking subset of large data sets @ time helped me solve expanded tree cache full errors.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -