Hi Damon,
I ran the profiler on cq for the following query which was taking time
and I passed the hard-coded values where required.
*let $options :=
("document","collation=http://marklogic.com/collation/","frequency-order")
let $base-query := cts:directory-query("/content/", "infinity")
let $values :=
cts:element-values(fn:QName("http://www.xyz.com/app/meta","Country"),
"", $options, $base-query)
return fn:count($values)*
According to profiler,
cts:element-values(fn:QName("http://www.xyz.com/app/meta","Country"),
"", $options, $base-query) has the maximum shallow-%.
Then I ran xdmp:plan() on the same statement :-
cts:element-values(fn:QName("http://www.xyz.com/app/meta","Country"),
"", $options, $base-query)
and I got the following result :-
*<qry:query-plan xmlns:qry="http://marklogic.com/cts/query">
<qry:error-trace><error:error
xmlns:error="http://marklogic.com/xdmp/error"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<error:code>XDMP-UNSEARCHABLE</error:code>
<error:name/>
<error:xquery-version>0.9-ml</error:xquery-version>
<error:message>Expression is unsearchable</error:message>
<error:format-string>XDMP-UNSEARCHABLE:
xdmp:plan(cts:element-values(fn:expanded-QName("http://www.xyz.com/app/meta",
"Country"), "", ("document",
"collation=http://marklogic.com/collation/", "frequency-order"),
cts:directory-query("/content/", "infinity"))) -- Expression is
unsearchable</error:format-string>
<error:retryable>false</error:retryable>
<error:expr>xdmp:plan(cts:element-values(fn:expanded-QName("http://www.xyz.com/app/meta",
"Country"), "", ("document",
"collation=http://marklogic.com/collation/", "frequency-order"),
cts:directory-query("/content/", "infinity")))</error:expr>
<error:data/>
<error:stack>
<error:frame>
<error:line>4</error:line>
<error:operation>xdmp:eval("let $options :=
(&quot;document&quot;,&quot;collation=http://mar...", (),
<options
xmlns="xdmp:eval"><database>12438542817496803555</database><default-xquery-version...</options>)</error:operation>
<error:variables>
<error:variable>
<error:name xmlns="">options</error:name>
<error:value>("document",
"collation=http://marklogic.com/collation/",
"frequency-order")</error:value>
</error:variable>
<error:variable>
<error:name xmlns="">base-query</error:name>
<error:value>cts:directory-query("/content/",
"infinity")</error:value>
</error:variable>
</error:variables>
<error:xquery-version>0.9-ml</error:xquery-version>
</error:frame>
<error:frame>
<error:uri>/eval.xqy</error:uri>
<error:line>115</error:line>
<error:xquery-version>1.0-ml</error:xquery-version>
</error:frame>
</error:stack>
</error:error></qry:error-trace>
</qry:query-plan>
What setting should i do in database to fasten the query?**
Note :- *element-range-index is set for the 'Country' element.
Thanks and Regards,
Jaspreet
On Sun, Mar 11, 2012 at 2:45 AM, Jonathan Cook - FM&T <
[email protected]> wrote:
> **
>
> I've written up a blog post on how to profile your code and the steps I
> went through.
>
> http://joncook.github.com/blog/2012/02/12/evaluating-mark-logic-xquery-performance/
>
> Jon
>
>
>
> -----Original Message-----
> From: [email protected] on behalf of Michael
> Blakeley
> Sent: Tue 28.02.2012 05:47
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] SVC:EXTIME -- Time limit exceeded
>
> First, profile your code to figure out which bit is taking so long. Then
> rewrite it so it's faster. Repeat until you are happy with performance.
>
> If you post code and profiler output here, you might get some suggestions.
>
> -- Mike
>
> On 27 Feb 2012, at 21:28 , JASPREET SINGH wrote:
>
> > Hi,
> >
> > I am getting an error SVC:EXTIME -- Time limit exceeded error during
> search. We have a .NET application that sends request to XDBC server of
> MarkLogic. We have set the request time out limit as 30 secs which we have
> to keep anyhow for fast performance.
> > But when we search millions of documents inside MarkLogic server, we get
> the above mentioned error.
> >
> > What would be the best way to resolve this error? What server settings
> we should make to optimize our search results?
> >
> > Thanks and Regards,
> > Jaspreet Singh
> >
> > _______________________________________________
> > General mailing list
> > [email protected]
> > http://developer.marklogic.com/mailman/listinfo/general
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general