MarkLogic:光学 API 花费/运行时间不稳定

问题描述 投票:0回答:1

我一直在研究 MarkLogic Optics API 功能,注意到完成代码执行所需的时间不稳定,可能需要长达 40 秒或约 1-2 分钟才能完成,有时也需要超过一个小时将激活超时错误。

这是由于缓存或我可能错过的某些设置造成的吗?或者运行时间低是由于之前失败/不完整执行的缓存造成的?我在下面发布了一组代码,因为它可能有助于解决此问题。

import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy";
import module namespace ofn="http://marklogic.com/optic/expression/fn" at "/MarkLogic/optic/optic-fn.xqy";
import module namespace thsr="http://marklogic.com/xdmp/thesaurus" 
   at "/MarkLogic/thesaurus.xqy";

xdmp:set-transaction-time-limit(3600),
let $people := op:from-lexicons(
  map:entry("comments",cts:uri-reference()),
  "lexicon")
  =>op:where(
   thsr:expand(
   cts:element-word-query(xs:QName("text"),"go"), 
   thsr:lookup("/myThsrDocs/wordnet.xml", "go"),
   (), 
   (), 
   () )
  )

let $questions := op:from-sparql('SELECT * WHERE {?comment </date_commented> ?date. }', "sparql")
                => op:select(( "date", op:as('commentStr',ofn:string(op:col('comment'))) ))

return(
xdmp:elapsed-time(),
$questions  => op:join-inner(
    $people,
    op:on(
      "comments","commentStr"
    )
  )
  => op:select(("comments")) 
  => op:group-by((), op:count("Total","comments"))
  => op:result()
,
xdmp:elapsed-time()
)
marklogic marklogic-9 marklogic-optic-api
1个回答
3
投票

这可能是由于选择了不同的查询计划,并表明成本函数中可能存在错误。您应该与 MarkLogic 支持人员合作来追踪问题并为其打开错误。

© www.soinside.com 2019 - 2024. All rights reserved.